mysql-5.5 for Linux source installation

Source: Internet
Author: User

mysql-5.5 for LinuxSource Installation
1.UseYumInstalling dependent Packages

# yum install-y gcc gcc-c++ gcc-g77 autoconf automake bison zlib* fiex* \

libxml* Ncurses-devel libmcrypt* libtool-ltdl-devel*

2.installationCMake

# yum Install-y cmake

3.unzip and compile the installationMySQLSource Package

# tar XZVF mysql-5.5.27.tar.gz

# mv mysql-5.5.27 MySQL

# CD MySQL

# Configuration compilation (Ref. : http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html)

# cmake-dcmake_install_prefix=/usr/local/mysql \

-DSYSCONFDIR=/USRL/LOCAL/MYSQL/ETC \

-dmysql_datadir=/usr/local/mysql/data \

-dmysql_tcp_port=3306 \

-dmysql_unix_addr=/tmp/mysql.sock \

-dmysql_user=mysql \

-ddefault_charset=utf8 \

-DDEFAULT_COLLATION=UTF8_GENERAL_CI \

-dwith_extra_charsets=all \

-dwith_readline=1 \

-dwith_ssl=system \

-dwith_embedded_server=1 \

-denabled_local_infile=1 \

-dwith_myisam_storage_engine=1 \

-dwith_memory_storage_engine=1 \

-dwith_innobase_storage_engine=1

# make

# make Install

Precautions:

When you recompile, you need to clear the old object file and cache information.

# Make Clean

# rm-f CMakeCache.txt

4.AddMySQLuser and user groups and modify all permissions on the directory

[[email protected] mysql]# Groupadd MySQL

[[email protected] mysql]# useradd-r-g MySQL MySQL

[Email protected] mysql]# chown-r mysql/usr/local/mysql

[Email protected] mysql]# chgrp-r mysql/usr/local/mysql

5.install the underlying database and copy the sample configuration file

# Cd/usr/local/mysql

# chmod +x scripts/*

[Email protected] mysql]#/scripts/mysql_install_db--basedir=/usr/local/mysql \

--datadir=/usr/local/mysql/data--user=mysql

# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF

[[email protected] ~]# export path= $PATH:/usr/local/mysql/bin// Global declaration path of mysql command

[[email protected] ~]# echo "path= $PATH:/usr/local/mysql/bin" >>/etc/profile// Write boot file

6.RegisterMySQLsystem Services and start upMySQL

[Email protected] mysql]# chmod 755 support-files/mysql.server

[Email protected] mysql]# ls-l support-files/mysql.server

-rwxr-xr-x 1 mysql MySQL 10650 6 month 19:21 support-files/mysql.server

[email protected] mysql]# CP Support-files/mysql.server/etc/init.d/mysql

[Email protected] mysql]# chown Root.root/etc/init.d/mysql

[[email protected] mysql]# chkconfig--add MySQL

[Email protected] mysql]# chkconfig--level MySQL on

[[email protected] mysql]# chkconfig--list MySQL

MySQL 0: off 1: off 2: enable 3: enable 4: Enable 5: enable 6: off

[[Email protected] mysql]# service MySQL start

Starting MySQL ... [ OK ]

[[email protected] mysql]# netstat-ltu |grep MySQL

TCP 0 0 *:mysql *:* LISTEN

[Email protected] mysql]# Ps-ef | grep MySQL

Root 15492 1 0 21:00 pts/0 00:00:00/bin/sh/usr/local/mysql/bin/mysqld_safe

--datadir=/usr/local/mysql/data--pid-file=/usr/local/mysql/data/ttt.pid

MySQL 15744 15492 0 21:00 pts/0 00:00:00/usr/local/mysql/bin/mysqld--

Basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--plugin-

Dir=/usr/local/mysql/lib/plugin--user=mysql--log-error=/usr/local/mysql/data/ttt.err

--pid-file=/usr/local/mysql/data/ttt.pid--socket=/tmp/mysql.sock--port=3306

Root 15896 1098 0 21:10 pts/0 00:00:00 grep mysql

7.installation complete, startMySQLdatabase, go to test

[Email protected] ~]# mysql-u root

Welcome to the MySQL Monitor. Commands End With; or \g.

Your MySQL Connection ID is 3

Server Version:5.5.27-log Source Distribution

Copyright (c), +, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its

Affiliates. Other names trademarks of their respective

Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| Information_schema |

| MySQL |

| Performance_schema |

| Test |

+--------------------+

4 rows in Set (0.00 sec)

mysql> use MySQL

Database changed

Mysql> Show tables;

+---------------------------+

| Tables_in_mysql |

+---------------------------+

| Columns_priv |

| db |

| Event |

| Func |

| General_log |

| Help_category |

| Help_keyword |

| help_relation |

| Help_topic |

| Host |

| Ndb_binlog_index |

| Plugin |

| Proc |

| Procs_priv |

| Proxies_priv |

| Servers |

| Slow_log |

| Tables_priv |

| Time_zone |

| Time_zone_leap_second |

| Time_zone_name |

| time_zone_transition |

| Time_zone_transition_type |

| user |

+---------------------------+

Rows in Set (0.00 sec)

Mysql>

8.ModifyMySQLDatabaseRootuser Password and login verification

[[email protected] ~]# mysqladmin-u root password ' mysqlpass '--set a password for the "root" user

[Email protected] ~]# mysql-u root-p

Enter Password:

Welcome to the MySQL Monitor. Commands End With; or \g.

Your MySQL Connection ID is 5

Server Version:5.5.27-log Source Distribution

Copyright (c), +, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its

Affiliates. Other names trademarks of their respective

Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| Information_schema |

| MySQL |

| Performance_schema |

| Test |

+--------------------+

4 rows in Set (0.00 sec)

Mysql>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.