Mysql

Windows 10 更新後 MySQL InnoDB 現在出現錯誤

  • August 11, 2021

這兩件事看似無關,但我剛剛做了一次Windows更新,突然間,MariaDB無法啟動。我收到以下錯誤:

InnoDB: using atomic writes.
2021-08-11 14:10:20 0 [Note] InnoDB: Uses event mutexes
2021-08-11 14:10:20 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-11 14:10:20 0 [Note] InnoDB: Number of pools: 1
2021-08-11 14:10:20 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2021-08-11 14:10:20 0 [Note] InnoDB: Initializing buffer pool, total size = 4294967296, chunk size = 134217728
2021-08-11 14:10:20 0 [Note] InnoDB: Completed initialization of buffer pool
2021-08-11 14:10:20 0 [Note] InnoDB: 128 rollback segments are active.
2021-08-11 14:10:20 0 [ERROR] InnoDB: Page [page id: space=0, page number=829] log sequence number 294540333006 is in the future! Current system log sequence number 276853913212.
2021-08-11 14:10:20 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.
2021-08-11 14:10:20 0 [ERROR] InnoDB: Page [page id: space=0, page number=349] log sequence number 294540502122 is in the future! Current system log sequence number 276853913212.
2021-08-11 14:10:20 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.
2021-08-11 14:10:20 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-08-11 14:10:20 0 [Note] InnoDB: Setting file '\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-08-11 14:10:20 0 [Note] InnoDB: File '\xampp\mysql\data\ibtmp1' size is now 12 MB.
2021-08-11 14:10:20 0 [Note] InnoDB: 10.5.9 started; log sequence number 276853913200; transaction id 35725767
2021-08-11 14:10:20 0 [Note] InnoDB: !!! innodb_force_recovery is set to 1 !!!
2021-08-11 14:10:20 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-08-11 14:10:20 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2021-08-11 14:10:20 0 [Note] Server socket created on IP: '127.0.0.1'.

在 Windows 更新後重新啟動之前,我關閉了 MySQL 和 Apache(我正在使用 XAMPP)。執行的更新是這樣的:“Windows 10 的功能更新,版本 20H2”

我什至不知道在哪裡查看故障排除 - 有什麼想法嗎?我google了錯誤“日誌序列號在將來”,找到了兩篇文章,但沒有解決方案。

我的 Windows 應用程序錯誤日誌充滿了條目,從“無法創建新的主文件”到“列名不匹配”。

有什麼提示嗎?我擔心我可能失去了數據,這可能是非常災難性的。

編輯:我按照建議的答案,並沒有得到修復。甚至 innodb_force_recovery=6 也無法解決它。我正在使用 MariaDB 10.5.19。

感謝您的評論。我通過刪除 MySQL 的數據文件夾中的所有文件解決了這個問題,除了ibdata1文件和ib_logfile0. 重新啟動 MySQL 並且它工作。

我嘗試這樣做的原因是因為我要恢復大約一個月前的備份,並且看到這些文件不存在於該備份中,所以我嘗試了。如果有人知道為什麼會這樣,那麼獲得一些見解會很棒,但它確實有效。

引用自:https://dba.stackexchange.com/questions/297891