非正常关机时,innodb故障导致mysql无法启动的解决方法

本文记录了一次因非正常关机导致InnoDB出现故障,进而使MySQL无法启动的问题及解决过程。通过调整innodb_force_recovery参数并尝试数据导出与重建的方法最终解决了此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

非正常关机时,innodb故障导致mysql无法启动的解决方法

 

一次非正常关机,mysql无法启动。查看err日志,显示:

 

InnoDB: Starting crash recovery.

InnoDB: Reading tablespace information from the .ibd files...

InnoDB: Restoring possible half-written data pages from the doublewrite

InnoDB: buffer...

InnoDB: Error: trying to access page number 4294899072 in space 0,

InnoDB: space name ./ibdata1,

InnoDB: which is outside the tablespace bounds.

InnoDB: Byte offset 0, len 16384, i/o type 10.

InnoDB: If you get this error at mysqld startup, please check that

InnoDB: your my.cnf matches the ibdata files that you have in the

InnoDB: MySQL server.  www.2cto.com  

120331 1:03:41 InnoDB: Assertion failure in thread 3078932288 in file fil0fil.c line 4409

InnoDB: We intentionally generate a memory trap.

InnoDB: Submit a detailed bug report to https://bugs.mysql.com.

InnoDB: If you get repeated assertion failures or crashes, even

InnoDB: immediately after the mysqld startup, there may be

InnoDB: corruption in the InnoDB tablespace. Please refer to

InnoDB: https://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html

InnoDB: about forcing recovery.  www.2cto.com  

21:03:41 UTC - mysqld got signal 6 ;

 

没办法,只好在/etc/my.cnf中写入

[mysqld] innodb_force_recovery = 4

 

但是仍然无法启动。

改为:innodb_force_recovery = 6

数据库可以读出来,在6的情况下,是无法修改数据库的,也无法插入,只能导出。

 

用mysqldump导出,再把innodb_force_recovery改为0,但是数据无法导入。

 

最后还是删除了数据库重建。

 

这是第二次遇到这种错误,标记一下。

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值