部署MySQL-5.5.10

软件 :

操作系统类型: RHEL5

版: mysql-5.5.10.tar.gz

(1) 检查是否已安装编译工具 ,如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~]组添加 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]#使 && 进行安装

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 –用户= MySQL

(8) start mysql

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

[root@ rhel5 mysql]# ./bin/mysqld_safe –用户= 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 “根”;

MySQL的>同花顺特权;

MySQL的>放弃

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

checking whether port 3306 is opening or not.

发表评论