想要将 MySQL Datadir 移动到另一个分区
我想将所有 mysql 数据库移动到另一个分区。我已经尝试了那里的巴西指南,但我没有找到任何有效的!
每当我更改 my.cnf 中的“datadir”时,MySQL 就会停止运行!
$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
这是更多信息:
$ mysqld -u root
101110 16:37:03 [Warning] Ignoring user change to 'root' because the user was set to 'mysql' earlier on the command line
101110 16:37:03 [Warning] Can't create test file /home/krainboltgreene/repo/databases/mysql/krainboltgreene-desktop-gateway.lower-test
101110 16:37:03 [Warning] Can't create test file /home/krainboltgreene/repo/databases/mysql/krainboltgreene-desktop-gateway.lower-test
这是conf文件:
I'd like to move all my mysql databases to another parition. I've tried the brazillion guides out there but I've not found anything that works!
Whenever I change the 'datadir' in my.cnf MySQL ceases to function!
$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Here's some more info:
$ mysqld -u root
101110 16:37:03 [Warning] Ignoring user change to 'root' because the user was set to 'mysql' earlier on the command line
101110 16:37:03 [Warning] Can't create test file /home/krainboltgreene/repo/databases/mysql/krainboltgreene-desktop-gateway.lower-test
101110 16:37:03 [Warning] Can't create test file /home/krainboltgreene/repo/databases/mysql/krainboltgreene-desktop-gateway.lower-test
And here's the conf file:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如@cdhowie所说,看起来您可能只需要将新目录更改为mysql即可。这通常是通过 sudo chown -R mysql:mysql directoryname 来完成的,
让我们知道这是否有效。
As @cdhowie says, it looks like you may just need to chown your new directory to mysql. This is usually accomplished through
sudo chown -R mysql:mysql directoryname
Let us know if that works.