标签:
如移动到"/home/mysql/data",我的mysql是装在/usr/local/mysql下的
1. 将/usr/local/mysql/data移动到/home/mysql/data
mv /usr/local/mysql/data /home/mysql/data
2. 修改启动文件
vi /usr/local/mysql/support-files/mysql.server
修改如下行,指定datadir
datadir=/home/mysql/data
3. 修改配置文件
vi /etc/my.cnf
在[mysqld]下添加一行,指定datadir
datadir=/home/mysql/data
4. 重新启动mysql
/usr/local/mysql/support-files/mysql.server start
标签:
原文地址:http://www.cnblogs.com/sybblogs/p/5784622.html