SET FOREIGN_KEY_CHECKS = 0; -- to disable FK checks (ex: for delete purpose) SET FOREIGN_KEY_CHECKS = 1; -- to re-enable FK checks