A-A+
/usr/libexec/mysqld: Can’t find file: ‘./mysql/plugin.frm’ (errno: 13)
Centos6.5 直接复制mysql数据文件,对数据进行异地恢复,报如下错误:
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
160604 21:51:08 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
160604 21:51:08 InnoDB: Initializing buffer pool, size = 8.0M
160604 21:51:08 InnoDB: Completed initialization of buffer pool
160604 21:51:08 InnoDB: Started; log sequence number 0 44233
160604 21:51:08 [ERROR] Can't start server : Bind on unix socket: Permission denied
160604 21:51:08 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
160604 21:51:08 [ERROR] Aborting
经确认这不是mysql的问题,主要是SELINUX的限制。新目录上的安全上下文设置不正确。关闭selinux即可。
[root@localhost mysql]# getenforce
Enforcing
[root@localhost mysql]# setenforce 0
[root@localhost mysql]# /etc/init.d/mysqld start
正在启动 mysqld: [确定]
另外要确认数据目录的权限,更改目录属主,网上好多说InnoDB引擎的表无法直接复制数据文件,但我在实验中是可以正常复制之后启动的数据也没有问题,生产环境中还没有这么做过。