mysql exist in engine_MySQL Table doesn't exist in engine 解决方法

数据表设置了外键,在phpMyAdmin中显示该表使用中,点击访问表时提示Table doesn’t exist in engine。

mysql日志显示:

2019-08-24 14:32:25 616 [Warning] InnoDB: Load table ‘xxx’ failed, the table has missing foreign key indexes. Turn off ‘foreign_key_checks’ and try again.

2019-08-24 14:32:25 616 [Warning] InnoDB: Cannot open table xxx from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.

判断为外键出错所致,执行下述SQL语句关闭外键检查即可进入该表:

SET FOREIGN_KEY_CHECKS = 0;

//或者

SET GLOBAL FOREIGN_KEY_CHECKS = 0;

重新调整外键,并把外键检查重新开启即可。

SET FOREIGN_KEY_CHECK = 1;

//或者

SET GLOBAL FOREIGN_KEY_CHECKS = 1;

另外有时候删除与出问题的表没有关联的数据库时,好像也有几率出现此问题,通过上述关闭、打开外键检查就可以恢复,而无需调整任何外键的设置,可能是InnoDB的bug。

原文:https://tlingc.com/2019/08/solving-mysql-table-doesnt-exist-in-engine/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值