硬盘空间满导致mysql ibd文件被删后提示Tablespace is missing for table ‘db_rsk/XXX“
昨天一早,开发人员反馈说一个测试环境报Tablespace is missing for table ‘db_rsk/XXX“,周末刚升级过,特地让开发回去查了下,说脚本中肯定没有drop table的操作。datadir下检查了下,发现frm文件在的ibd文件没有了,bing了下,没发现类似异常。于是先回到mysql.err往回搜索,半天后发现上周五下午mysql出现了一次异常宕机,说是磁盘空间不足了,看日志该文件被损坏了,如下:
171128 10:09:29 InnoDB: cannot calculate statistics for table gadmobe/cpi_partner
InnoDB: because the .ibd file is missing. For help, please refer to
InnoDB:
http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html
171128 10:09:29 [ERROR] MySQL is trying to open a table handle but the .ibd file for
table gadmobe/cpi_partner does not exist.
Have you deleted the .ibd file from the