Mysql Error 1064 (4200) - Using BTREE

Trying to move a database from my development machine which is running MySQL 5.1.41 on Ubuntu to my server, which is Ubuntu but runs MySQL 5.0.51a and I keep getting an error:
ERROR 1064 (42000) at line 122: 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 `FrtTP_Feature` (`featureId`), CONSTRAINT `FrtTP_Feature` F' at line 4
On my development machine, I can dump and upload the database just fine, but it won't import all the tables to MySQL on my production box. Obviously the differing MySQL versions are causing problems. I searched on the internets, but nothing much useful came up, as that error seems to be used for everything. I'm finding out that MySQL's errors are anything but informative. After some digging on MySQL's site, I found the syntax USING BTREE has moved to after the key description in versions greater than 5.1. After changing my database dump file, I can now upload all my tables and data to my production server. You would think they would wait until major version numbers to choke on the placement of that syntax.... Below are the changes I made to get 5.1.41 to work with 5.0.51a:
UNIQUE KEY `url_unique` (`url`,`memberId`) USING BTREE becomes UNIQUE KEY `url_unique` USING BTREE (`url`,`memberId`) and PRIMARY KEY (`memberId`,`tripreportPhotoId`) USING BTREE becomes PRIMARY KEY USING BTREE (`memberId`,`tripreportPhotoId`)

Posted In: mysql

Commentary

Anonymous 2011-01-21 02:48:56

Thanks, that solved the problem. I was banging my head against the wall until I came here. You would think they would have kept the syntax the same??

Isabel 2011-05-23 21:25:08

Please tell me how do I have the solution if I use workbench to export database in mysql5.1.36 and I import database in mysql5.0.88