250901-MySQL-LogFile-ib_logfile启动异常处理

异常信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2025-09-01T01:38:07.723468Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 1108276937 and the end 1108281882.
2025-09-01T01:38:07.723499Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2025-09-01T01:38:08.332206Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2025-09-01T01:38:08.332263Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2025-09-01T01:38:08.332280Z 0 [ERROR] Failed to initialize builtin plugins.
2025-09-01T01:38:08.332294Z 0 [ERROR] Aborting

2025-09-01T01:38:08.332312Z 0 [Note] Binlog end
2025-09-01T01:38:08.332392Z 0 [Note] Shutting down plugin 'CSV'
2025-09-01T01:38:08.334119Z 0 [Note] mysqld: Shutdown complete


2025-09-01T03:20:31.722426Z 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 http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2025-09-01T03:20:31.722543Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=635] log sequence number 1041821149 is in the future! Current system log sequence number 1040642590.
2025-09-01T03:20:31.722583Z 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 http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2025-09-01T03:20:31.722683Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=1371] log sequence number 1040709155 is in the future! Current system log sequence number 1040642590.

从你提供的日志来看,
MySQL 在启动时遇到了与 InnoDB 存储引擎相关的问题,导致无法正常启动。
以下是日志中显示的几个关键问题及其可能的原因:

1. InnoDB 忽略重做日志

1
2
3
2025-09-01T01:38:07.723468Z 0 [ERROR] 
InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT
between the checkpoint 1108276937 and the end 1108281882.
  • 问题描述:InnoDB 在启动时检查重做日志(redo log),发现缺少 MLOG_CHECKPOINT,导致无法正确恢复数据。
  • 可能原因
    • 数据库在上次关闭时没有正常关闭,导致重做日志不完整。
    • 数据文件(如 ibdata1ib_logfile*)可能被损坏或丢失。

2. 可以尝试删除的文件

**ib_logfile\***:这些是 InnoDB 的重做日志文件,用于恢复操作

在某些情况下,可以尝试删除一些临时文件或日志文件,但需要谨慎操作:

  • **ib_logfile\***:如果这些文件损坏,可以尝试删除它们,然后重新启动 MySQL。MySQL 会自动重新创建这些文件。但请注意,这可能会导致一些未提交的事务丢失。
  • **\*.err**:这是 MySQL 的错误日志文件,删除它不会影响数据库的运行,但建议先备份,以便后续查看错误信息。