[ERROR] InnoDB: Trying to access page number 7 in space 957, space name XXX which is outside the tablespace bounds

早上,测试说演示环境mysql老实断开重连,一update就挂,经查日志,有如下异常:

2017-04-05T23:13:01.729250+08:00 17065 [ERROR] InnoDB: Trying to access page number 7 in space 957, space name db_rsk/tb_rsk_compliancecalcservice, which is outside the tablespace bounds. Byte offset 0, len 16
384, i/o type read. If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have in the MySQL server.
2017-04-05T23:13:01.729323+08:00 17065 [ERROR] InnoDB: Server exits.
2017-04-05T15:13:01.951492Z mysqld_safe Number of processes running now: 0
2017-04-05T15:13:01.966440Z mysqld_safe mysqld restarted

因为是演示环境,可以从其他环境恢复回来,故rm -rf db_rsk/tb_rsk_compliancecalcservice*后问题解决。

当然也可以通过innodb_force_recovery=N来启动,并export/恢复,只不过这样会花费更长时间。

所以,就mysql生产库而言,除了有backup之外,最好的方式是对于核心生产库使用raid盘,如果是ECS的话,做软raid。

原文地址:https://www.cnblogs.com/zhjh256/p/6671946.html