Monday, June 25, 2012

SQL Import problems with Sample Data Package for Magento 1.6.1.0

If you download the Sample Data Package for Magento 1.6.1.0 and use a MySQL server is less than 5.1, it can be when importing the SQL script come to the following SQL error:

niskia:/xxx1# mysql -u magento1 -pXXXXX --database=magento1 < magento_sample_data_for_1.6.1.0.sql
ERROR 1064 (42000) at line 8354: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE, KEY `FK_TAG_FIRST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` (`first_' at line 7


To go beyond this, you have 2 options - to manually fix the error in SQL file, OR to download patched file.

A patched file could be get from this link - http://www.narf-studios.de/fileadmin/download/magento-module/magento-sample-data-1.6.1.0.tar.gz . The description page is in German: http://www.narf-studios.de/kompetenzen/ecommerce/magento-tipps-tricks.html

Second way is to manually fix the file. Here is my diff for the original and patched file:

niskia:/xxx# diff magento-sample-data-1.6.1.0-orig/magento_sample_data_for_1.6.1.0.sql magento-sample-data-1.6.1.0-patched/magento_sample_data_for_1.6.1.0_fix.sql 8360c8360
< PRIMARY KEY (`tag_id`) USING BTREE,
---
> PRIMARY KEY USING BTREE (`tag_id`),
8407c8407
< PRIMARY KEY (`tag_relation_id`) USING BTREE,
---
> PRIMARY KEY USING BTREE (`tag_relation_id`),
niskia:/xxx#


Solved!

No comments:

Post a Comment