天天看點

mysql5.5 啟動報錯:File './mysql-bin.index' not found (Errcode: 13)

初始化玩資料庫之後,使用mysqld_safe啟動mysql資料庫,如下發現,啟動失敗

[root@SVNServer bin]# ./mysqld_safe --user=mysql&

[1] 20539

[root@SVNServer bin]# 110806 00:32:19 mysqld_safe Logging to '/usr/local/mysql5.5/data/SVNServer.err'.

110806 00:32:20 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql5.5/data

110806 00:32:20 mysqld_safe mysqld from pid file /usr/local/mysql5.5/data/SVNServer.pid ended

上面隻能看到mysql啟動失敗,具體的原因,需要檢視資料庫目錄下的.err檔案,檢視.err檔案,内容如下:

^G/usr/local/mysql5.5/bin/mysqld: File './mysql-bin.index' not found (Errcode: 13)

110806  0:32:20 [ERROR] Aborting

110806  0:32:20 [Note] /usr/local/mysql5.5/bin/mysqld: Shutdown complete

紅色字标出來的就是這次錯誤報告,errcode13,一般就是權限問題,mysql使用者是否對資料庫目錄内的所有檔案具有寫的權限,檢視一下權限,如下圖

mysql5.5 啟動報錯:File './mysql-bin.index' not found (Errcode: 13)

發現問題了,果然是權限問題,下面排錯就簡單了,将data目錄的有所者賦給mysql使用者,redhat系統中可以使用,chown mysql.mysql -R data

好了,現在再啟動一下mysql,如下圖,沒有報錯

mysql5.5 啟動報錯:File './mysql-bin.index' not found (Errcode: 13)