Deployment of MySQL-5.5.10

softwoare :

OS type: RHEL5

version: mysql-5.5.10.tar.gz

(1) check whether the compile tools have been installed ,such as gcc , gcc-c++ ,cmake etc

If they haven’t been installed, you can install them by yum

yum install gcc gcc-c++ make cmake automake

(2) create mysql installation dictionary and data dictionary

[root@ rhel5~]#mkdir -p /usr/local/mysql

[root@ rhel5~]#mkdir -p /usr/local/mysql/data

(3) create mysql user and it’s group

[root@ rhel5~]groupadd mysql

[root@ rhel5~]useradd -r -g mysql mysql

(4) formal installation

[root@ rhel5 local]#tar -zxv -f mysql-5.5.10.tar.gz

compile parameter:

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql

-DMYSQL_DATADIR=/usr/local/mysql/data

-DDEFAULT_CHARSET=utf8

-DDEFAULT_COLLATION=utf8_general_ci

-DEXTRA_CHARSETS=all

-DENABLED_LOCAL_INFILE=1

[root@ rhel5 mysql-5.5.10]#make && make install

This command will take a long time, please be patient.

(5) set permission for mysql dictionary

[root@ rhel5~]# cd /usr/local/mysql

[root@ rhel5 mysql]# chown -R mysql:mysql .

[root@ rhel5 mysql]# chown -R mysql:mysql data

(6)cp original configuration file and startup script

[root@ rhel5 mysql]# cp …/mysql/support-files/my-default.cnf /etc/my.cnf

[root@ rhel5 mysql]# cp …/mysql/support-files/mysql.server /etc/init.d/mysqld

(7) mysql initialization

[root@ rhel5 mysql]# cd /usr/local/mysql

[root@ rhel5 mysql]# scripts/mysql_install_db –user=mysql

(8) start mysql

[root@ rhel5~]# cd /usr/local/mysql

[root@ rhel5 mysql]# ./bin/mysqld_safe –user=mysql &

(9) set root password and it’s permission, making root can connect mysql from any client.

[root@ rhel5~]# mysql -u root mysql

mysql> GRANT ALL PRIVILEGES ON *.* TO root@”%” IDENTIFIED BY “root”;

mysql>flush privileges;

mysql>quit

If you can not connect it from remote client , you may need to exam iptables configuration,

checking whether port 3306 is opening or not.

Leave a Reply