This will most likely occur when migrating Magento from one host to another. The fix, while not so obvious and easy t find turned out to be quite easy ;) During the installation, Magento sets two IDs to 0 in its database. However, when importing the database dump to your new host, MySQL doesn’t like this and changes these ID’s to 2, which of course is not what Magento needs to load, thus the error. The fix is quite easy — set these IDs back to 0.
The IDs, we need are for ‘admin’ in the tables:
Just open phpMyAdmin and change 2 to 0, clear Magento’s cache by deleting the contents of the /var/cache folder and Voila!
Also, it will be a good idea to check the box for “Disable foreign key checks”, when exporting it in the firt place, as you will surely receive an error for this when importing ;)
You’re awesome…thanks for the tip!