I have Ubuntu Desktop 11.04 and I'm trying to move /var/lib/mysql to a TrueCrypt volume and am failing at every attempt.
This is for development purposes, and there's a particular database I need to work with that needs to be highly secure for numerous reasons.
Upon a fresh install of mysql-server and mysql-client, I'm able to start mysql without any problem. So I then move /var/lib/mysql to the TrueCrypt volume (call it /foo/truecrypt), and then edit /etc/mysql/my.cnf to point datadir to /foo/truecrypt.
After I check permissions to make sure that they are the same, I try to start mysql again.
It doesn't work (MySQL just continues to hang), and I'm unable to get MySQL to work again (even after killing all mysql processes and moving the datadir back to /var/lib/mysql). I've done a apt-get --purge remove mysql-client mysql-server mysql-common (and then deleted all files in /var/lib/mysql, etc/mysql/ and /var/log/mysql*) at least 5 times tonight in order to get a fresh install to try again.
While MySQL hangs, I've gone into /var/log/mysql/ and here's what shows up in mysql.err:
120421 22:50:03 [Note] Plugin 'FEDERATED' is disabled. ^G/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 120421 22:50:03 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 120421 22:50:03 InnoDB: Initializing buffer pool, size = 8.0M 120421 22:50:03 InnoDB: Completed initialization of buffer pool 120421 22:50:03 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.
I've tried moving /var/lib/mysql/ and then creating a symlink instead of editing my.cnf. That doesn't make a difference. The errors above indicate a missing file or permissions issues. However, plugin.frm exists in /foo/truectrypt/mysql/mysql (as I simply just moved the parent directory), and ownership and permissions on that and all other files in that directory are the same as they were.
Do you have any suggestions? I'm stumped.