我有安装 MySQL 5.5.33.0 的 Windows 2016 标准操作系统。 今天早上发现mysql服务器没有运行,无法开机。当我尝试打开它时,它立即崩溃,并且事件查看器中只有异常信息 0xc0000005。我什至无法运行 mysqlcheck,因为它在 mysqld 未运行时不起作用。
我将非常感谢您的任何建议。
我能够在 MySQL 设置中启用日志记录和设置路径。日志中有相当多的条目带有此文本(数字更改):
210107 10:28:21 InnoDB: Error: page 33382 log sequence number 114951961648
InnoDB: is in the future! Current system log sequence number 111386529682.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files.
See InnoDB: dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: for more information.
210107 10:32:33 InnoDB: Error: Insert buffer insert fails; page free 43, dtuple size 50
InnoDB: Cannot insert index record DATA TUPLE: 2 fields;
0: len 40; hex 436f6d70757465722050726573732020202020202020202020202020202020202020202020202020;
asc Computer Press ;;
1: len 4; hex 800070da; asc p ;;
InnoDB: The table where this index record belongs
InnoDB: is now probably corrupt. Please run CHECK TABLE on
InnoDB: that table.
InnoDB: space 0, page 109621, zip_size 0, bitmap bits 1
进度更新: 我设法用 innodb_force_recovery = 3 启动 MySQL,它甚至运行了一段时间。如果我运行 mysqlcheck.exe --all-databases --auto-repair,它会报告这种类型的某些表中的损坏:
Warning: InnoDB: Index 'ix_linear_pole' contains 1683314 entries, should be 1683294.
然而,检查并没有运行到最后,对于一个特定的表,整个 mysql 服务器再次崩溃。
更新:我发现错误是在InnoDB缓冲区中加载的命令中,但我不知道如何删除它。每次我打开服务器时,缓冲区中的命令都会使其崩溃。
答案 0 :(得分:1)
经过几个小时的研究,我发现 MySQL 无法加载 InnoDB Buffer。最简单的方法是在 my.ini 中添加一个命令
innodb_force_recovery = 4
但是,数据库仅针对 SHOW 数据启动。使用mysqldump,我备份了没有索引的数据。然后我从服务器中删除了数据库,我也从系统中删除了日志和数据库数据(C:\ProgramData\...\MySQL\data\ibdata 和 iblog0 和 iblog1)。然后我停止了 MySQL 并删除了 innodb_force_recovery。然后数据库运行了,但没有数据。 我使用正常恢复上传了原始数据并创建了索引。
从那一刻起,一切正常。