MySql5.7 异常关机后,启动报错,无法启动

2022-12-09 13:57:20 浏览数 (1)

本文为joshua317原创文章,转载请注明:转载自joshua317博客 https://www.joshua317.com/article/289

简介: 最近测试环境做迁移,mysql服务器没有正常关机,导致登录后发现无法启动数据库

报错信息如下:

代码语言:javascript复制
2022-12-03T05:06:34.717722Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see 
documentation for more details).
2022-12-03T05:06:34.719329Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.38-log) starting as process 69185 ...
2022-12-03T05:06:34.724300Z 0 [Note] InnoDB: PUNCH HOLE support available
2022-12-03T05:06:34.724361Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-12-03T05:06:34.724376Z 0 [Note] InnoDB: Uses event mutexes
2022-12-03T05:06:34.724381Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2022-12-03T05:06:34.724386Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-12-03T05:06:34.724390Z 0 [Note] InnoDB: Using Linux native AIO
2022-12-03T05:06:34.724679Z 0 [Note] InnoDB: Number of pools: 1
2022-12-03T05:06:34.724839Z 0 [Note] InnoDB: Using CPU crc32 instructions
2022-12-03T05:06:34.726620Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2022-12-03T05:06:34.736731Z 0 [Note] InnoDB: Completed initialization of buffer pool
2022-12-03T05:06:34.739288Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of set
priority().
2022-12-03T05:06:34.751284Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2022-12-03T05:06:34.753105Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 176529205866 and the end 1765292058
15.
2022-12-03T05:06:34.753144Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2022-12-03T05:06:35.353972Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-12-03T05:06:35.354057Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2022-12-03T05:06:35.354069Z 0 [ERROR] Failed to initialize builtin plugins.
2022-12-03T05:06:35.354082Z 0 [ERROR] Aborting

2022-12-03T05:06:35.354141Z 0 [Note] Binlog end
2022-12-03T05:06:35.354259Z 0 [Note] Shutting down plugin 'CSV'
2022-12-03T05:06:35.354701Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

解决:

代码语言:javascript复制
1. 查看启动日志发现报错Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint,按照网上方法,在/etc/my.cnf 加innodb_force_recovery ,但没效果,依旧报错
2. 然后尝试删除数据目录下ib_logfile0、ib_logfile1文件,再去启动,记得先备份这两个文件,防止继续报错,无法尝试其他操作,删除后启动正常,数据相关也在。

注意:删除数据目录下ib_logfile0、ib_logfile1文件时,先备份

本文为joshua317原创文章,转载请注明:转载自joshua317博客 https://www.joshua317.com/article/289

0 人点赞