今天在 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 服務后,都會自動創建的。
最后,故障解決。
(完)