XAMPP:MySQL 无法启动,可能是 InnoDB 数据库损坏了

问题描述 投票:0回答:1

这是在 Windows 11 上的 XAMPP 上运行的 MySQL。

我以为从 XAMPP 控制面板关闭 MySQL 是可以的,显然不是。现在它不会再开始了。

我试过innodb_force_recovery。没有备份,我前几天刚设置的。我需要很多新数据。

这里是日志:

2023-03-27 15:24:27 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2023-03-27 15:24:27 0 [Note] InnoDB: Uses event mutexes
2023-03-27 15:24:27 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2023-03-27 15:24:27 0 [Note] InnoDB: Number of pools: 1
2023-03-27 15:24:27 0 [Note] InnoDB: Using SSE2 crc32 instructions
2023-03-27 15:24:27 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2023-03-27 15:24:27 0 [Note] InnoDB: Completed initialization of buffer pool
2023-03-27 15:24:27 0 [ERROR] InnoDB: Missing MLOG_CHECKPOINT at 20136596 between the checkpoint 20136596 and the end 20136448.
2023-03-27 15:24:27 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2023-03-27 15:24:27 0 [Note] InnoDB: Starting shutdown...
2023-03-27 15:24:27 0 [ERROR] Plugin 'InnoDB' init function returned error.
2023-03-27 15:24:27 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2023-03-27 15:24:27 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-03-27 15:24:27 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2023-03-27 15:24:27 0 [ERROR] Aborting
2023-03-27 15:24:35 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2023-03-27 15:24:35 0 [Note] InnoDB: Uses event mutexes
2023-03-27 15:24:35 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2023-03-27 15:24:35 0 [Note] InnoDB: Number of pools: 1
2023-03-27 15:24:35 0 [Note] InnoDB: Using SSE2 crc32 instructions
2023-03-27 15:24:35 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2023-03-27 15:24:35 0 [Note] InnoDB: Completed initialization of buffer pool
2023-03-27 15:24:35 0 [ERROR] InnoDB: Missing MLOG_CHECKPOINT at 20136596 between the checkpoint 20136596 and the end 20136448.
2023-03-27 15:24:35 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2023-03-27 15:24:35 0 [Note] InnoDB: Starting shutdown...
2023-03-27 15:24:35 0 [ERROR] Plugin 'InnoDB' init function returned error.
2023-03-27 15:24:35 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2023-03-27 15:24:35 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-03-27 15:24:35 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2023-03-27 15:24:35 0 [ERROR] Aborting
2023-03-27 15:27:23 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2023-03-27 15:27:23 0 [Note] InnoDB: Uses event mutexes
2023-03-27 15:27:23 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2023-03-27 15:27:23 0 [Note] InnoDB: Number of pools: 1
2023-03-27 15:27:23 0 [Note] InnoDB: Using SSE2 crc32 instructions
2023-03-27 15:27:23 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2023-03-27 15:27:23 0 [Note] InnoDB: Completed initialization of buffer pool
2023-03-27 15:27:23 0 [ERROR] InnoDB: Missing MLOG_CHECKPOINT at 20136596 between the checkpoint 20136596 and the end 20136448.
2023-03-27 15:27:23 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2023-03-27 15:27:23 0 [Note] InnoDB: Starting shutdown...
2023-03-27 15:27:23 0 [ERROR] Plugin 'InnoDB' init function returned error.
2023-03-27 15:27:23 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2023-03-27 15:27:23 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-03-27 15:27:23 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2023-03-27 15:27:23 0 [ERROR] Aborting

我试试 innodb_force_recovery 3

2023-03-27 15:59:29 0 [Note] InnoDB: !!! innodb_force_recovery is set to 3 !!!
2023-03-27 15:59:29 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2023-03-27 15:59:29 0 [Note] InnoDB: Uses event mutexes
2023-03-27 15:59:29 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2023-03-27 15:59:29 0 [Note] InnoDB: Number of pools: 1
2023-03-27 15:59:29 0 [Note] InnoDB: Using SSE2 crc32 instructions
2023-03-27 15:59:29 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2023-03-27 15:59:29 0 [Note] InnoDB: Completed initialization of buffer pool
2023-03-27 15:59:29 0 [ERROR] InnoDB: Missing MLOG_CHECKPOINT at 20136596 between the checkpoint 20136596 and the end 20136448.
2023-03-27 15:59:29 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2023-03-27 15:59:29 0 [Note] InnoDB: Starting shutdown...
2023-03-27 15:59:29 0 [ERROR] Plugin 'InnoDB' init function returned error.
2023-03-27 15:59:29 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2023-03-27 15:59:29 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-03-27 15:59:29 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2023-03-27 15:59:29 0 [ERROR] Aborting

我尝试 innodb_force_recovery 6,日志很高兴但是没有任何反应,mysql 仍然没有启动。

2023-03-27 15:59:52 0 [Note] InnoDB: !!! innodb_force_recovery is set to 6 !!!
2023-03-27 15:59:52 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2023-03-27 15:59:52 0 [Note] InnoDB: Uses event mutexes
2023-03-27 15:59:52 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2023-03-27 15:59:52 0 [Note] InnoDB: Number of pools: 1
2023-03-27 15:59:52 0 [Note] InnoDB: Using SSE2 crc32 instructions
2023-03-27 15:59:52 0 [Note] InnoDB: Disabling background log and ibuf IO write threads.
2023-03-27 15:59:52 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2023-03-27 15:59:52 0 [Note] InnoDB: Completed initialization of buffer pool
2023-03-27 15:59:52 0 [Note] InnoDB: innodb_force_recovery=6 skips redo log apply
2023-03-27 15:59:52 0 [Note] InnoDB: 10.4.27 started; log sequence number 0; transaction id 0
2023-03-27 15:59:52 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-03-27 15:59:52 0 [Note] Server socket created on IP: '::'.

有什么想法吗?

mysql xampp innodb data-recovery
1个回答
0
投票

根据提供的日志,该问题似乎与损坏的 InnoDB 数据库有关。 InnoDB 是 MySQL 用来管理表中数据的存储引擎。当 InnoDB 的数据库文件出现问题时,可能会导致无法启动 MySQL 服务器。

一个解决方案是尝试手动修复 InnoDB 数据库。以下是执行此操作的步骤:

  1. 停止 MySQL 服务器

  2. 在 MySQL 数据目录中找到 InnoDB 数据文件。这些 文件通常具有 .ibd 扩展名。

  3. 创建 InnoDB 文件的备份到另一个目录以防止 进一步的数据丢失。

  4. 从中删除 InnoDB 日志文件(ib_logfile0 和 ib_logfile1) 数据目录。

  5. 启动 MySQL 服务器,这将创建新的 InnoDB 日志文件。

  6. 查看MySQL错误日志,查看服务器是否已经启动 正确。如果不是,请尝试将 InnoDB 恢复级别提高 将以下行添加到 my.cnf 文件:innodb_force_recovery = X(其中 X 是恢复水平)

  7. 服务器启动成功后,尝试访问 表。如果表已损坏,则可能需要修复它们 使用 MySQL 修复工具或 Stellar 等第三方工具 修复 MySQL。

Stellar Repair for MySQL 是专为修复损坏的 MySQL 数据库(包括 InnoDB 文件)而设计的工具。它可以扫描和修复数据库,恢复所有数据库对象。但是,建议先尝试手动修复方法,然后再借助第三方工具将它们恢复到新数据库。

#mysql

© www.soinside.com 2019 - 2024. All rights reserved.