We tried to restore an export of our database and ended up crashing our Magento store. I looked into the DB and saw that there was no store in the core_store table with an id of 0. In fact, the default store had an ID of 2.
Researching this issue, I’ve found that MySQL has a nasty import bug. If you use 0 as your starting index in an auto_increment field, then when you reimport the data mySQL sees it as a Null and gives it the next index for the table.
The way to get around this bug is to put the following line in your import file before the beginning of the SQL statements.