重启MYSQL的时候出现的如下问题mysql
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 endedweb
当初觉得只是文件或文件夹权限问题,把全部对应的目录和文件的权限改为读写状态...仍是没用...sql
在网上找了一下子,找到解决方法了~spa
解决方法以下:orm
#在终端中先输入下面这一行server
chown -R mysql:mysql /home/data/mysql
#在输入下面的一行就OK了ci
chcon -R -t mysqld_db_t /home/mysqlrem
#重启下MYSQL试试~it
删除了以下三个文件:io
[root@tserver mysql]# rm ibdata1 ib_logfile0 ib_logfile1 rm: remove regular file `ibdata1'? yes rm: remove regular file `ib_logfile0'? yes rm: remove regular file `ib_logfile1'? yes