今天重装mysql到新电脑,之后覆盖mysql的data目录(意在恢复以前的数据库),之后启动服务,提示错误信息
“本地计算机 上的 MySQL 服务启动后停止。某些服务在未由其他服务或程序使用时将自动停止。”查看日志,具体如下
2021-05-25T14:41:43.226769Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-05-25T14:41:43.226890Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2021-05-25T14:41:43.227484Z 0 [Note] MySQL (mysqld 5.7.30) starting as process 13068 ...
2021-05-25T14:41:43.233537Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-05-25T14:41:43.234031Z 0 [Note] InnoDB: Uses event mutexes
2021-05-25T14:41:43.234382Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2021-05-25T14:41:43.234806Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-05-25T14:41:43.235444Z 0 [Note] InnoDB: Number of pools: 1
2021-05-25T14:41:43.235897Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2021-05-25T14:41:43.239065Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-05-25T14:41:43.245756Z 0 [Note] InnoDB: Completed initialization of buffer pool
2021-05-25T14:41:43.277351Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2021-05-25T14:41:43.279984Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 58566894 and the end 58566656.
2021-05-25T14:41:43.280638Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-05-25T14:41:43.493123Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-05-25T14:41:43.493685Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-05-25T14:41:43.494223Z 0 [ERROR] Failed to initialize builtin plugins.
2021-05-25T14:41:43.494632Z 0 [ERROR] Aborting
2021-05-25T14:41:43.494943Z 0 [Note] Binlog end
2021-05-25T14:41:43.495311Z 0 [Note] Shutting down plugin 'CSV'
2021-05-25T14:41:43.495891Z 0 [Note] MySQL: Shutdown complete
[ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 58566894 and the end 58566656.
看第一行可以推测出是恢复日志的问题, 删除b_logfile0和ib_logfile1等文件,接着重新启动就可以了