想要将 MySQL Datadir 移动到另一个分区

发布于 2024-10-01 20:48:49 字数 812 浏览 1 评论 0原文

我想将所有 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文件:

https://gist.github.com/672763

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:

https://gist.github.com/672763

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

年华零落成诗 2024-10-08 20:48:49

正如@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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文