重启服务器出现Can't find file: './mysql/plugin.frm' 和 Unknown table engine 'InnoDB'

      日志分析的kettle跑批无故变慢,分析了多种情况后没有解决问题。决定重启服务器,重启服务器后,发现上面的mysql数据库启动不了,提示如下:  /usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)

110222 11:15:07 mysqld_safe Starting mysqld daemon with databases from /home/mysql
110222 11:15:07 [Warning] Can't create test file /home/mysql/localhost.lower-test
110222 11:15:07 [Warning] Can't create test file /home/mysql/localhost.lower-test
 /usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
110222 11:15:07 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110222 11:15:07  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 ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
110222 11:15:07 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

 解决方法如下:

#在终端中先输入下面这一行

chown -R mysql:mysql /home/data/mysql
#在输入下面的一行就OK了

chcon -R -t mysqld_db_t /home/mysql

#重启下MYSQL试试~

 

     重启mysql是OK了,但是访问数据库表的时候提示:Unknown table engine 'InnoDB',用了网上各种方法,修改了my.cnf N次,都没有解决。最后把防火墙关闭了setenforce 0,数据能正常访问。

     百度了一下,还是没理解防火墙和innodb有什么关系?记录一下该问题,为后面遇见这种问题的提供一个解决方案。

 

你可能感兴趣的:(mysql)