- 配置
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local/webserver/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
# Next command is optional
shell> cp support-files/my-default.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &
- 修改mysql.server脚本
将
basedir=
datadir=
改为
basedir=/usr/local/webserver/mysql
datadir=/usr/local/webserver/mysql/data
- 配置启动脚本
cd /usr/local/webserver/mysql
cp support-files/mysql.server /etc/init.d/mysql
- 启动mysql
service mysql start
service mysql stop
service mysql restart
- 配置的参考资料
- 安装配置