If you need to drop several tables, for example because you need to then restore them, you may arrive at the following error:
ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
That happens if there are tables with foreign keys references to the table you are trying to drop.
All you need to do is:
SET FOREIGN_KEY_CHECKS=0Drop your tables
SET FOREIGN_KEY_CHECKS=1
Comments
Post new comment