mysql datadir迁移
时间:2010-04-26 来源:wcw
想把mysql中数据库文件放到其它地方,大概有2步:
1,修改/etc/mysql/my.cnf里的datadir选项
#datadir = /var/lib/mysql
datadir = /mnt/mysql
2,修改datadir目录权限:
刚开始忘了这一步,出现了下面的错误:
# /etc/init.d/mysql start
* Starting mysql ...
* Starting mysql (/etc/mysql/my.cnf)
* MySQL NOT started (1) [!!]
后来查看了原来的datadir目录才发现权限不对,于是:
chown mysql:mysql /mnt/mysql/ -R
这样mysqld就能正常启动了
1,修改/etc/mysql/my.cnf里的datadir选项
#datadir = /var/lib/mysql
datadir = /mnt/mysql
2,修改datadir目录权限:
刚开始忘了这一步,出现了下面的错误:
# /etc/init.d/mysql start
* Starting mysql ...
* Starting mysql (/etc/mysql/my.cnf)
* MySQL NOT started (1) [!!]
后来查看了原来的datadir目录才发现权限不对,于是:
chown mysql:mysql /mnt/mysql/ -R
这样mysqld就能正常启动了
相关阅读 更多 +