SQL constraints are usually good, as they help maintain a certain consistency of the database. But sometimes they suck. And when they do, they suck really bad and yield some weird errors, most common being:
Can’t create table
Annoying little error, isn’t it? Especially when you want to load a backup dump and you can’t because of unfulfilled constrains. This has happened to me on several occasions, especially since I’ve switched over to InnoDB and started using constraints. So far, I was unable to find any elegant solution, just to switch the foreign key checks off at the beginning of the import and switch them back on at the end.
SET FOREIGN_KEY_CHECKS = 0;
# regular dump goes here
# CREATE TABLE `my_table` (...)
# bla bla bla
SET FOREIGN_KEY_CHECKS = 1;
Not exactly rocket science, but I hope it saves you some headaches.