1. 程式人生 > >MySQL服務無法啟動,Innodb初始化失敗處理。

MySQL服務無法啟動,Innodb初始化失敗處理。

早幾天在 Linux 部署了LAMP(Linux+Apache+MySQL+PHP+phpMyAdmin)架構,玩了一下MySQL 5.6.26,比較穩定。

今天在Windows安裝部署了 MySQL 5.5.45 for Community 社群版,由於開啟了很多其它的Win應用程式,導致記憶體使用過大。 平時啟動都正常的 MySQL,現在啟動報失敗了,查了Win的系統事件日誌和 MySQL 的err日誌檔案(如下),報如下Innodb初始化失敗的錯誤:

170117  3:04:40 [Note] Plugin 'FEDERATED' is disabled.
170117  3:04:40 InnoDB: The InnoDB memory heap is disabled


170117  3:04:40 InnoDB: Mutexes and rw_locks use Windows interlocked functions
170117  3:04:40 InnoDB: Compressed tables use zlib 1.2.3
170117  3:04:40 InnoDB: Initializing buffer pool, size = 500.0M
170117  3:04:40 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file .\ib_logfile0 is of different size 0 922746880 bytes
InnoDB: than specified in the .cnf file 0 146800640 bytes!
170117  3:04:40 [ERROR] Plugin 'InnoDB' init function returned error.
170117  3:04:40 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170117  3:04:40 [ERROR] Unknown/unsupported storage engine: INNODB
170117  3:04:40 [ERROR] Aborting

檢查 my.ini 檔案的 innodb_buffer_pool_size引數值等於1G。後來把引數值改為500M,重新啟動MySQL服務,還是報如上錯誤。

最後根據以上提示,將MySQL安裝目錄 %MySQL_HOME%/data 目錄下的日誌檔案 ib_logfile0 和 ib_logfile1 改名,再重新啟動 MySQL服務就可以了。

這兩個日誌檔案如果不存在,每次啟動MySQL服務後,都會自動建立的。

最後,故障解決。

(完)