[MySQL错误]Can't find file: ./mysql/plugin.frm

错误提示:

/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
180530 15:19:43 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

版本环境:

mysql> select version();
+------------+
| version()  |
+------------+
| 5.1.73-log |
+------------+

做主从复制时,把主库的mysql整个目录都复制到了备库的目录下,启动服务失败,查看日志,出现这个错误:

#vim /var/log/mysqld.log
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
180530 15:19:43 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

到mysql目录中,发现plugin.frm文件是存在的,权限也是mysql

google了一下,发现是因为开启了SELinux造成的,关闭SELinux即可正常启动MySQL

关闭SELinux:

临时关闭: #setenforce 0

永久关闭:

#vim /etc/sysconfig/selinux
SELINUX=disabled