In my production database life, there was one tragic incident when the MySQL engine type was accidentally changed from InnoDB to MyISAM on restoring a recent backup. The result was that all referential integrity were lost.
What could have caused this incident? My production database is MySQL Server 5.1.
Best Answer
This brings to mind something I have done a dozen times (fortunately with small datasets less then 10GB). When restoring a mysqldump to a new server, you must make absolutely sure the InnoDB settings on the new server is identical to the InnoDB settings.
For a new server that you have opted to restore a mysqldump to, run this command:
This will display all storage engines available in in the MySQL instance. Here is a sample from a server running MySQL 5.5.9:
Notice that InnoDB has DEFAULT in the Support Column. There are four possible values for the Support column:
One day, a server I was restoring to had mismatched configurations on the innodb_buffer_pool_size. Because I had set innodb_buffer_pool_size=512G instead of 512M (obvious typo), InnoDB would come up DISABLED. When loading the data into the new server, every CREATE TABLE defaulted to MyISAM upon execution. I didn't notice anything until I saw dozens of DB Connections that were waiting to write to the same table, which was typical of heavy writes against MyISAM. The solution was simply to start over with the correct InnoDB settings and reload.
MORAL OF THE STORY