0

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...

Craig
  • 289
  • 2
  • 7

2 Answers2

1

It seems you have permission issue on mysql datadir

  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.

Can you change the permission of datadir and also change the ownership to mysql. Once this is done than give restart to Mysql.

1

well I'm not sure why apparmor balked at "/u/apps/mysql/** rwk" when the original entry was "/var/lib/mysql/** rwk" and /u/apps/mysql was clearly owned mysql.mysql , but when I changed the setting to "/u/apps/** rwk" and it worked

Craig
  • 289
  • 2
  • 7