MySQL 出現 InnoDB STORAGE ENGINE failed 修復

MySQL 要從備份還原啟動,但是發生啟動失敗,在 mysql 的 error log 裡面看到下述訊息。

Unable to start MySQL service: Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

InnoDB: Using Linux native AIO
InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported storage engine: InnoDB

170122 12:01:00  InnoDB: Warning: table 'mysql/innodb_index_stats' InnoDB: in InnoDB data dictionary has unknown flags 50.
170122 12:01:00  InnoDB: Warning: table 'test/collect' InnoDB: in InnoDB data dictionary has unknown flags 50.
170122 12:01:00 [ERROR] /usr/sbin/mysqld: Table './mysql/user' is marked as crashed and should be repaired
170122 12:01:00 [Warning] Checking table:   './mysql/user'
170122 12:01:00 [ERROR] 1 client is using or hasn't closed the table properly
170122 12:01:00  InnoDB: Warning: table 'test/users'
InnoDB: in InnoDB data dictionary has unknown flags 50.

要怎麼修復呢?

MySQL 出現 InnoDB STORAGE ENGINE failed 修復

下述解法取自此篇:Unable to start MySQL service: Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

  1. vim /etc/my.cnf
    innodbfastshutdown=0
  2. 啟動看看,若還是不行,在加上下述參數
  3. vim /etc/my.cnf
    innodb_log_file_size=5M
  4. 啟動看看,若還是不行,將 ib_logfile0、ib_logfile1 先搬走
    • mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile1 /tmp/
  5. sudo systemctl restart mysql.service # 照理說到這邊應該就可以動了
  6. 再不行,就把 /var/lib/ib_logfie 都搬走
    • mv /var/lib/ib_logfie /tmp/

註:ib_logfile0、ib_logfie1 有什麼用處,可見此篇:在MYSQL中,ib_logfile0,ib_logfile1有什麼用?怎麼打開看?

相關網頁

作者: Tsung

對新奇的事物都很有興趣, 喜歡簡單的東西, 過簡單的生活.

發表迴響

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料