InnoDB:由于缺少 MLOG_CHECKPOINT 而忽略重做日志

Dus*_*wal 13 mysql innodb mysql-5.7

我正在使用 mysql 版本 5.7.14(在 OS X El Capitan 上安装自制软件)。我的系统在 mysql 运行时没有正确关闭,重新启动后,当我尝试启动 mysql 守护程序时,我收到以下错误。

2017-02-07T10:11:42.224506Z 0 [Note] mysqld (mysqld 5.7.14) starting as process 18234 ...
2017-02-07T10:11:42.227375Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2017-02-07T10:11:42.228809Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-02-07T10:11:42.228821Z 0 [Note] InnoDB: Uses event mutexes
2017-02-07T10:11:42.228826Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-02-07T10:11:42.228830Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-02-07T10:11:42.229114Z 0 [Note] InnoDB: Number of pools: 1
2017-02-07T10:11:42.229227Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-02-07T10:11:42.230512Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-02-07T10:11:42.239632Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-02-07T10:11:42.270103Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-02-07T10:11:42.270567Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 44002250712 and the end 44002250240.
2017-02-07T10:11:42.270606Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-02-07T10:11:42.577436Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-02-07T10:11:42.577470Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-02-07T10:11:42.577484Z 0 [ERROR] Failed to initialize plugins.
2017-02-07T10:11:42.577488Z 0 [ERROR] Aborting
Run Code Online (Sandbox Code Playgroud)

我尝试重新启动 mysqld,innodb-force-recovery=1但没有成功。谁能指导我如何从这种状态中恢复。

小智 21

请尝试以下操作:

  1. 设置innodb_log_checksums = ON在主从。
  2. 删除rm /var/lib/mysql/ib_logfile*
  3. 重新开始。

  • 请注意,当您删除这些文件时,您将删除重做日志,这意味着如果服务器在发生故障时非常活跃,您将丢失事务并可能损坏服务器。有些人报告说“它对我有用”,因为它在没有负载的服务器上是无害的,但在生产中尝试通过删除 innodb 日志文件来启动崩溃的服务器几乎肯定会导致数据丢失和其他问题。 (5认同)
  • 删除 ib_logfile 您将丢失数据。 (2认同)
  • @digz6666 在我发表评论之前我做了,它工作得很好,没有任何损失,而且数据库立即启动,哈哈 (2认同)