I'm running ubuntu 12.04 and moved the datadir for my mysql server (retaining same ownerships and permissions) from /var/lib/mysql to /u/apps/mysql in /etc/mysql/my.cnf, then I updated /etc/apparmor.d/usr.sbin.mysqld to include:
/u/apps/mysql r,
/u/apps/mysql/** rwk,
but get the error:
InnoDB: Reading tablespace information from the .ibd files...
130906 13:55:31 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 .
InnoDB: File operation call: 'opendir'.
InnoDB: Cannot continue operation.
so I disable apparmor and it starts. It looks like the directory it wants to open is '.' which I was assuming would be /u/apps/mysql but apparently is not. Since changing the apparmor config it definitely gets further along but I have no idea what it's choking on. Any ideas what's going on? Thanks...