SET FOREIGN_KEY_CHECKS = 0; truncate table "yourTableName"; SET FOREIGN_KEY_CHECKS = 1;
Here is what the above code is Doing:
1. Setting the foreign key checks to 0. This will allow you to truncate the table even if there are foreign key constraints.
2. Truncating the table.
3. Setting the foreign key checks back to 1.