rhel6源码安装mysql_RedHat 6.1下MySQL 5.5源码安装

第七步,编译安装

[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!0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值