When trying to update a local copy of one of my MySQL databases, I got the error
Cannot delete or update a parent row: a foreign key constraint fails
when issuing the command
DROP TABLE IF EXISTS `table_a`;
As I immediately recreate the tables with the necessary foreign key constraints, I wanted to temporarily remove the constraints. After some Googl’ing, I learned that it is as simple as
SET foreign_key_checks = 0; DROP TABLE IF EXISTS `table_a`; SET foreign_key_checks = 1;