Can't find file: './mysql/plugin.frm' 啓動mysql出錯

重啓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

相關文章
相關標籤/搜索