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 `mydatabase`.`mytable` (errno: 150)
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.
As you probably know, the most popular Open Source RDBMS, MySQL, is being acquired by Oracle, which – some say – will most likely mean the end of the open source project. MySQL has been eroding Oracle’s profits for quite some time now, and there’s a fat chance that Oracle will kill MySQL in order to keep its high profits.