Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

MySQL import tip
 
GregC
Sr. Member
 
Avatar
Total Posts:  76
Joined:  2007-11-23
A^2, MI
 

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.

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

GregC

 
Magento Community Magento Community
Magento Community
Magento Community
 
Casper
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2008-04-08
 

Thanks GregC for sharing this. I just had the same problem and fixed it whit your single line of SQL.

Many thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
danilodimoia
Member
 
Total Posts:  36
Joined:  2008-04-21
Chieti
 

Wonderful! It worked also for me grin and, Casper, thanks for sharing this link!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Casper
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2008-04-08
 

Your welcome danilodimoia.

 
Magento Community Magento Community
Magento Community
Magento Community
 
camulatz
Jr. Member
 
Total Posts:  7
Joined:  2008-12-13
 

Thank you very much grin

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top