WordPress 預設使用 InnoDB 引擎,若 MySQL 僅啟用 MyISAM 會導致服務異常。本文記錄作者在 Windows 環境下透過安裝精靈切換引擎、遭遇 ib_logfile 尺寸不符、No valid checkpoint 等錯誤,最終透過刪除舊日誌檔案、重啟系統成功完成遷移的完整排查過程。
Mysqld-nt.exe 應用程式錯誤、記憶體無法讀取、服務自動停止。關鍵日誌位於 MySQL安裝目錄\Data\主機名.err:
InnoDB: Error: log file .\ib_logfile0 is of different size 0 52428800 bytes
InnoDB: than specified in the .cnf file 0 10485760 bytes!
[ERROR] Default storage engine (InnoDB) is not available
[ERROR] Aborting
後續刪除 ib_logfile0 重啟,又出現 ib_logfile1 同樣尺寸不符錯誤。
del ib_logfile0
del ib_logfile1
del ibdata1
InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 109 MB
InnoDB: Progress in MB: 100
...
InnoDB: Started; log sequence number 0 0
[Note] mysqld: ready for connections.
.err 檔案是診斷 InnoDB 啟動失敗的首要線索。my.ini 為 my.ini.timestamp.bak,可快速回滾。D:\MySQL InnoDB Datafiles),提升 I/O 效能。mysql> SHOW ENGINES;
+--------------------+---------+----------------------------------------------------------------+
| Engine | Support | Comment |
+--------------------+---------+----------------------------------------------------------------+
| InnoDB | DEFAULT | Supports transactions, row-level locking, foreign keys |
| MyISAM | YES | MyISAM storage engine |
+--------------------+---------+----------------------------------------------------------------+
確認 InnoDB 為 DEFAULT 即遷移成功。
引擎遷移屬於核心架構變更,生產環境務必先在測試環境完整演練,並準備完整備份與回滾方案。本案例展示了從錯誤日誌入手、逐步排除 ib_logfile 尺寸衝突、checkpoint 失效等典型 InnoDB 啟動障礙的標準排查路徑。