Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
1  
have you changed the datadir directive in my.cnf ? –  Abhishek Anand Amralkar Sep 7 '13 at 6:36
    
did you change ownership of /u/apps/mysql ? –  GioMac Sep 7 '13 at 9:50
    
I've edited the question to clarify where I changed the datadir and that I retained same ownerships/permissions –  Craig Sep 9 '13 at 2:52

2 Answers 2

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.