Mysql Error 1064 (4200) - Using BTREE
Sep 9th, 2010
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:
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:
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`)
PRIMARY KEY (`memberId`,`tripreportPhotoId`) USING BTREE becomes PRIMARY KEY USING BTREE (`memberId`,`tripreportPhotoId`)
Posted In: mysql | 3 comments