MySQL-5.5.10のデプロイ

softwoare :

OSタイプ: 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~]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]#作る && インストールする

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 “ルート”;

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.

返信を残します