HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

"Can't find file mysql/plugin.frm" when starting up MySQL

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
startingcanfilefrmmysqlpluginfindwhen

Problem

When I start my MySQL server, I get this error:

/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.


I have run mysql_upgrade to rebuild it, and it works to rebuild. Before I did that, I removed and installed MySQL. However, when I tried to re-start, I get the same error. I am sure it is not a permission problem, as all files and directories are created by the mysql user.

Could you advise me on how to fix this error?

Solution

If you have mysql data directory at non-standard location and your system has apparmor, ensure that /etc/apparmor.d/usr.sbin.mysqld has your data directory whitelisted. The configuration should look like:

/mysql/data/dir/ r, #trailing slash is mandatory
/mysql/data/dir/** rwk,


Apparmor daemon has to be restarted after you make any changes to config.

Code Snippets

/mysql/data/dir/ r, #trailing slash is mandatory
/mysql/data/dir/** rwk,

Context

StackExchange Database Administrators Q#56441, answer score: 18

Revisions (0)

No revisions yet.