To disable foreign key constraints when you want to truncate a table: Use FOREIGN_KEY_CHECKS and remember to enable it when you’re done: