简体   繁体   English

MySQL 服务器崩溃,InnoDB 超出表空间边界

[英]MySQL server crashes, InnoDB outside the tablespace bounds

I have a C# application performing some database operations on a MySQL 5.7 server.我有一个 C# 应用程序在 MySQL 5.7 服务器上执行一些数据库操作。 Once the complete system hunp up and I had to hard-reset it.一旦整个系统连接起来,我就不得不对其进行硬重置。 When it comes to a specific table read/write operation now the database server crashes.现在,当涉及到特定的表读/写操作时,数据库服务器崩溃了。 The windows log shows windows日志显示

InnoDB: Trying to access page number 286720 in space 29, 
space name myInstance/myTable, which is outside the tablespace bounds.
Byte offset 0, len 16384, i/o type read. 

I tried to use mysqlcheck --repair but it fails because note : The storage engine for the table doesn't support repair .我尝试使用mysqlcheck --repair但它失败了,因为note : The storage engine for the table doesn't support repair

I've read some advices that say I should start MySQL in a recovery mode, so I added我读过一些建议,说我应该在恢复模式下启动 MySQL,所以我添加了

[mysqld]
innodb_force_recovery=4

to the my.ini config file whereupon I should be able to use mysqldump to export the affected database table.my.ini配置文件,因此我应该能够使用mysqldump导出受影响的数据库表。 But unfortunatelly I am not.但不幸的是我不是。

mysqldump: Error 2013: Lost connection to MySQL server 
during query when dumping table `myTable` at row: 1246

Edit:编辑:

I checked the error log again and found lots of entries saying我再次检查了错误日志,发现很多条目说

[ERROR] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe: 
The table 'myTable' is full

I'm running the server on a Windows 32bit OS with an NTFS formatted partition.我在带有 NTFS 格式分区的 Windows 32 位操作系统上运行服务器。 The myTable.ibd file size is around 4.5 GB, checking C.10.3 Limits on Table Size states a file size limit of "2TB (possibly larger)" for Win32 w/ NTFS. myTable.ibd文件大小约为 4.5 GB,检查C.10.3 表大小限制规定 Win32 w/NTFS 的文件大小限制为“2TB(可能更大)”。 While checking the reasons for my error the only possible cause I found was a full InnoDB tablespace.在检查错误原因时,我发现唯一可能的原因是 InnoDB 表空间已满。 The solution might be "Changing the Number or Size of InnoDB Redo Log Files" although the coherence is a bit vague to me.解决方案可能是“更改 InnoDB 重做日志文件的数量或大小”,尽管一致性对我来说有点模糊。 Nevertheless I increased the size of the Redo Log Files from 48M to 100M.尽管如此,我还是将重做日志文件的大小从 48M 增加到了 100M。 But nothing changed.但什么都没有改变。

If I perform a SQL select * from myTable order by Id desc the server crashes instantly.如果我select * from myTable order by Id desc执行 SQL select * from myTable order by Id desc服务器立即崩溃。 Error log entry is exactly the same as above.错误日志条目与上述完全相同。

I checked the chapter 15.7.1 Resizing the InnoDB System Tablespace as well and found out that innodb_data_file_path is not explicitly specified.我还检查了第15.7.1调整 InnoDB 系统表空间的大小,发现没有明确指定innodb_data_file_path

Any ideas what I can do now?任何想法我现在可以做什么? Thanks a lot!非常感谢!

InnoDB cannot repair corruption in tablespaces. InnoDB 无法修复表空间中的损坏。 This was never implemented and mysqlcheck won't help in any way.这从未实现, mysqlcheck不会以任何方式提供帮助。

The corruption is in space id 29 which is table myInstance.myTable.损坏位于空间 id 29 中,即表 myInstance.myTable。 To repair it you need to dump all records from this table with innodb_force_recovery.要修复它,您需要使用 innodb_force_recovery 转储此表中的所有记录。 Try all values from 4 to 6 until MySQL doesn't crash.尝试从 4 到 6 的所有值,直到 MySQL 不会崩溃。 Then drop the table and reload the dump.然后删除表并重新加载转储。

If MySQL crashes even with innodb_force_recovery=6 then restore the table from backup.如果 MySQL 在innodb_force_recovery=6崩溃,则从备份中恢复表。

If you don't have backup - use script http://bazaar.launchpad.net/~percona-dev/percona-data-recovery-tool-for-innodb/trunk/view/head:/fetch_data.sh .如果您没有备份 - 使用脚本http://bazaar.launchpad.net/~percona-dev/percona-data-recovery-tool-for-innodb/trunk/view/head:/fetch_data.sh It will fetch as many records as it can.它将获取尽可能多的记录。

One possible cause could be that the ib_logfile* files are corrupted.一种可能的原因可能是ib_logfile*文件已损坏。

To fix this, remove these files using rm ib_logfile* .要解决此问题,请使用rm ib_logfile*删除这些文件。

Where are these files?这些文件在哪里? These files are in mysql datadir .这些文件在 mysql datadir The location of datadir depends on the OS. datadir的位置取决于操作系统。 Check my.cnf , in osx that should be in /usr/local/etc .检查my.cnf ,在 osx 中应该在/usr/local/etc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM