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

时间:2010-11-11 00:57:36

标签: mysql configuration directory ubuntu-10.04 database-partitioning

我想把我所有的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

1 个答案:

答案 0 :(得分:0)

正如@cdhowie所说,看起来你可能只需要将你的新目录chown到mysql。这通常通过sudo chown -R mysql:mysql directoryname

完成

如果有效,请告诉我们。