删除表A的时提示提示“mysql Cannot delete or update a parent row: a foreign key constraint fails”,表示A表与其他表存在参照完整性约束。
解决方法1:
关闭约束检查 删除约束检查 开启约束检查;示例代码如下:
SET foreign_key_checks = 0;
drop table A;
SET foreign_key_checks = 1;
解决方法2:
点击table,找到约束名,删除约束,然后再删除表。
ALTER TABLE tab_name DROP FOREIGN KEY fk_name
drop table tbill