InnoDB: ./ib_logfile0 can't be opened in read-write mode.

問題介紹:從一個備份恢復到一個新的實例上面,啓動mysql的 時候報如下錯

2018-02-28T02:38:00.618787Z 0 [ERROR] InnoDB: ./ib_logfile0 can't be opened in read-write mode.
2018-02-28T02:38:00.618805Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-02-28T02:38:01.219287Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-02-28T02:38:01.219316Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-02-28T02:38:01.219323Z 0 [ERROR] Failed to initialize plugins.
2018-02-28T02:38:01.219332Z 0 [ERROR] Aborting

2018-02-28T02:38:01.219340Z 0 [Note] Binlog end
2018-02-28T02:38:01.219885Z 0 [Note] mysqld: Shutdown complete


原因:因爲是之前使用過的數據庫,現在需要重新部署,就要清空log文件。

解決方法:
1、關閉mysql數據庫
2、進入mysql的data目錄,刪除以下3個文件:ib_logfile0和 ib_logfile1 ib_logfile2


[root@localhost data]# mv ib_logfile0 ib_logfile0.bak
[root@localhost data]# mv ib_logfile1 ib_logfile1.bak
[root@localhost data]# mv ib_logfile2 ib_logfile2.bak


3、重新啓動mysql


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章