mysqldump 经常会遇到版本不一致引起的导入到处问题, 本文给出了参考解决方法。
http://www.magento-vietnam.com/magento-tips-tricks/magento-database-import-error/
Magento Database Import Error
ERROR 1064 (42000) at line 382: 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_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`),
KEY `FK_CATALO’ at line 9
The reason behind this is that there is an inconsistency in the way the export syntax was being handled as I imported into the staging environment (which evidently has a different MySQL version running). Thus, the staging site was expecting different syntax for the following:
–
– Table structure for table `catalog_category_entity_varchar`
–
DROP TABLE IF EXISTS `catalog_category_entity_varchar`;
CREATE TABLE `catalog_category_entity_varchar` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT ‘0′,
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT ‘0′,
`store_id` smallint(5) unsigned NOT NULL DEFAULT ‘0′,
`entity_id` int(10) unsigned NOT NULL DEFAULT ‘0′,
`value` varchar(255) NOT NULL DEFAULT ”,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`) USING BTREE,
KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE` (`store_id`)
) ENGINE=InnoDB AUTO_INCREMENT=697 DEFAULT CHARSET=utf8;
As a rule of thumb, one can either
- (1) head over to the MySQL Developer Documentation for syntax reference
- (2) or simply check out a recent Magento export from the server they are trying to import into and determine how the “USING BTREE” statement was handled. Likewise, I simply removed the following:
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`) USING BTREE,
and replaced it with this:
UNIQUE KEY `IDX_BASE` USING BTREE (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`),
Hope this helps someone who is experiencing the same error and spending way too much time trying to understand the incompatible syntax.
作者:yaozer 原文链接:MySQL server version for the right syntax to use near ‘USING BTREE
欢迎转载, 非常感谢你能注明作者和原始出处。
It’s actually a great and helpful piece of info. I’m glad that you shared this useful info with us. Please keep us up to date like this. Thanks for sharing.
Your blog provides a fresh look at the subject. Great job mate!
Hello, Neat post. There’s a problem with your site in internet explorer, could test thisˇK IE nonetheless is the marketplace chief and a good section of people will omit your fantastic writing due to this problem.
I’ve been exploring for a little for any high quality articles or blog posts on this kind of area . Exploring in Yahoo I at last stumbled upon this web site. Reading this information So i’m happy to convey that I have a very good uncanny feeling I discovered just what I needed. I most certainly will make certain to don’t forget this web site and give it a look regularly.
Appreciate your all of your endeavours that you have place in this. worth it to read data . ?The exile?ersus our life is absolutely no life.? through Leonidas associated with Tarentum.
I have observed that in the world the present moment, video games include the latest rage with children of all ages. There are occassions when it may be difficult to drag your family away from the games. If you want the best of both worlds, there are lots of educational video games for kids. Great post dedesmsf.