Magento: error message – Notice: Undefined index: 0 app/code/core/Mage/Core/Model/Mysql4/Config.php on line 92
- Tuesday, March 17th, 2009 -
The Quick resolution to this problem it to move the database command line, and not use phpmyadmin. If you just need to fix your database keep reading.
I was moving a installation to a production server and was getting this error message: Notice: Undefined index: 0 in app/code/core/Mage/Core/Model/Mysql4/Config.php on line 92. It took alot of searching to figure out the problem, but here is what I found. When Magento installs it sets store and website ids in the database. When transferring the database the new database did not like having an id of 0 for the admin part of the site, so it made it have an id of 2. This is what my problem was. To fix it I went into the core_store and core_website Tables and gave the admin site an id of 0. It looks like this may only affect certain versions of magento(Earlier versions). Hope this helps someone else.
P.S. I also got foreign_key_constraint errors when importing my database. To solve this disable foreign key check when you export your database. Then when you need to change the core_store and core_website id’s you will probably need to surround your sql with the following code:
set foreign_key_checks=0;
//SQL to update ids
SET FOREIGN_KEY_CHECKS=1;
