drop table `spring`.`city_inf`; Error 1217: Cannot delete or update a parent row: a foreign key constraint fails SQL Statement: drop table `spring`.`city_inf`
会抛出以上的错误,无法删除此表。
但是可以通过MySQL的 ———通过 set ”外键检查=0“ 暂时禁止外键的检查,然后删除从表
SET foreign_key_checks = 0; DROP TABLE `spring`.`city_inf`;
即可以顺利删除此表