第七步,编译安装
[root@serv01 mysql-5.5.29]# make && make install#确定安装目录存在[root@serv01 mysql-5.5.29]# ls/usr/local/mysql/
bin COPYING data docs include INSTALL-BINARY lib man mysql-test README scripts share sql-bench support-files
第八步,添加mysql组和用户
[root@serv01 opt]# groupadd -g 500 mysql
[root@serv01 opt]# useradd -u 500 -g 500 -r -M -s /sbin/nologin mysql
第九步,拷贝配置文件和启动脚本,并修改启动脚本的执行权限
[root@serv01 mysql-5.5.29]# cpsupport-files/my-medium.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y
[root@serv01 mysql-5.5.29]# cpsupport-files/mysql.server /etc/init.d/mysqld
[root@serv01 mysql-5.5.29]# chmod a+x/etc/init.d/mysqld
[root@serv01 mysql-5.5.29]# ls /usr/local/mysql/data/
mysql test
第十步,改变mysql目录的拥有者和所属组,并修改my.cnf文件,添加data目录
[root@serv01 mysql-5.5.29]# chown mysql.mysql/usr/local/mysql/ -R
[root@serv01 mysql-5.5.29]# vim /etc/my.cnf
[root@serv01 mysql-5.5.29]# cat /etc/my.cnf |grep datadir
datadir =/usr/local/mysql/data
第十一步,修改mysql_install_db的权限,使其可执行,并进行初始化操作
[root@serv01 mysql-5.5.29]# chmod a+xscripts/mysql_install_db
[root@serv01 mysql-5.5.29]#./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data/--basedir=/usr/local/mysql/
WARNING: The host 'serv01.host.com' could notbe looked up with resolveip.
This probably means that your libc librariesare not 100 % compatible
with this binary MySQL version. The MySQLdaemon, mysqld, should work
normally with the exception that host nameresolving will not work.
This means that you should use IP addressesinstead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right placefor your system
PLEASE REMEMBER TO SET A PASSWORD FOR THEMySQL root USER !
To do so, start the server, then issue thefollowing commands:
/usr/local/mysql//bin/mysqladmin -u rootpassword 'new-password'
/usr/local/mysql//bin/mysqladmin -u root -hserv01.host.com password 'new-password'
Alternatively you can run:
/usr/local/mysql//bin/mysql_secure_installation
which will also give you the option ofremoving the test
databases and anonymous user created bydefault. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/mysql/ ;/usr/local/mysql//bin/mysqld_safe &
You can test the MySQL daemon withmysql-test-run.pl
cd /usr/local/mysql//mysql-test ; perlmysql-test-run.pl
Please report any problems with the/usr/local/mysql//scripts/mysqlbug script!