5. 修改 MySQL 启动脚本 /etc/init.d/mysql
原内容
# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.
basedir=
datadir=
修改后的内容
# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.
basedir=
datadir=/disk/mysql
6. 启动 MySQL 服务器
-bash-3.2# service mysql start
Starting MySQL.. SUCCESS!
-bash-3.2# service mysql status
SUCCESS! MySQL running (4874)
-bash-3.2#
7. 测试 MySQL 访问是否正常
-bash-3.2# mysql -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 188
Server version: 5.5.25 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
O.K.!
