<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Elias Interactive &#187; 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 &#8216;USING BTREE</title>
	<atom:link href="http://www.eliasinteractive.com/blog/tag/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/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eliasinteractive.com</link>
	<description>Ecommerce consulting &#38; solutions for online store retailers</description>
	<lastBuildDate>Thu, 01 Sep 2011 18:45:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Magento Database Import Error: USING BTREE,   KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`),   KEY `FK_CATALO&#039; at line 9</title>
		<link>http://www.eliasinteractive.com/blog/magento-database-import-error-using-btree-key-fk_attribute_varchar_entity-entity_id-key-fk_catalo-at-line-9/</link>
		<comments>http://www.eliasinteractive.com/blog/magento-database-import-error-using-btree-key-fk_attribute_varchar_entity-entity_id-key-fk_catalo-at-line-9/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 02:10:28 +0000</pubDate>
		<dc:creator>Lee Taylor</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[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]]></category>
		<category><![CDATA[KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`)]]></category>
		<category><![CDATA[KEY `FK_CATALO' at line 9]]></category>
		<category><![CDATA[Magento Database Import Error]]></category>
		<category><![CDATA[Magento database migration]]></category>

		<guid isPermaLink="false">http://www.eliasinteractive.com/?p=919</guid>
		<description><![CDATA[Tonight I was setting up a staging environment for a client of ours so they would have the ability to &#8220;visually&#8221; interact with the recent data migration our team has performed (OSCommerce to Magento, in case anyone was wondering). Here&#8217;s the error I was receiving: The reason behind this is &#8230; <a href="http://www.eliasinteractive.com/blog/magento-database-import-error-using-btree-key-fk_attribute_varchar_entity-entity_id-key-fk_catalo-at-line-9/">Continue Reading <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Tonight I was setting up a staging environment for a client of ours so they would have the ability to &#8220;visually&#8221; interact with the recent data migration our team has performed (OSCommerce to Magento, in case anyone was wondering).</p>
<p>Here&#8217;s the error I was receiving:</p>
<pre class="brush: sql; light: true; title: ; notranslate">
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
</pre>
<p>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:</p>
<pre class="brush: sql; title: ; notranslate">
--
-- 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;
</pre>
<p>As a rule of thumb, one can either</p>
<ul>
<li><strong>(1)</strong> head over to the <a href="http://dev.mysql.com/doc/refman/5.4/en/create-table.html">MySQL Developer Documentation</a> for syntax reference</li>
<li><strong>(2) </strong>or simply check out a recent Magento export from the server they are trying to import into and determine how the &#8220;USING BTREE&#8221; statement was handled. Likewise, I simply removed the following:</li>
</ul>
<pre class="brush: sql; light: true; title: ; notranslate">
&lt;p style=&quot;text-align: left; &quot;&gt;UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`) USING BTREE,
</pre>
<p>and replaced it with this:</p>
<pre class="brush: sql; light: true; title: ; notranslate">
&lt;p style=&quot;text-align: left; &quot;&gt;UNIQUE KEY `IDX_BASE` USING BTREE (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`),
</pre>
<p>Hope this helps someone who is experiencing the same error and spending way too much time trying to understand the incompatible syntax.
<div id="tweetbutton919" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fbit.ly%2FiLoeoe&amp;via=tweetelias&amp;text=Magento%20Database%20Import%20Error%3A%20USING%20BTREE%2C%20%20%20KEY%20%60FK_ATTRIBUTE_VARCHAR_ENTITY%60%20%28%60entity_id%60%29%2C%20%20%20KEY...%20&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.eliasinteractive.com%2Fblog%2Fmagento-database-import-error-using-btree-key-fk_attribute_varchar_entity-entity_id-key-fk_catalo-at-line-9%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.eliasinteractive.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.eliasinteractive.com/blog/magento-database-import-error-using-btree-key-fk_attribute_varchar_entity-entity_id-key-fk_catalo-at-line-9/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
	</channel>
</rss>

