I've moved all the stuff in /var/lib/mysql
to /500gb/mysql
, and created a symbolic link from one to the other. I then did a chown mysql:mysql
and chmod 777
(with both -h and -R as necessary) to both the /var/lib/mysql
symbolic link, and also /500gb/mysql
.
ls -al /var/lib
gives me:
lrwxrwxrwx 1 mysql mysql 15 2011-07-27 12:55 mysql -> /500gb/mysql
When I try to start MySQL (service mysql start
), I get the following in /var/log/mysql/error.log
:
110727 12:48:32 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
110727 12:48:32 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110727 12:48:32 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
Both /500gb/mysql/ibdata1
and /500gb/mysql/mysql/plugin.frm
exist and are owned by mysql
. What's the deal?
Also, MySQL seems to occasionally clobber my symbolic link. It disappears and becomes a regular directory after a number of failed starts.
I've also tried editing my /etc/mysql/my.cnf
and setting datadir = /500gb/mysql
with no luck.
Any ideas? Thanks.