有時導入mysql會提示如下錯誤:
C:\Users\liqiang>mysql -uroot -paaaaaa guangxi <e:\data\ticai.sql
ERROR 1064 (42000) at line 486: 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 `Reference_1_FK` (`RoleID`),
CONSTRAINT `FK_userinfo_RoleID' at line 11
解決辦法是打開要導入的文件在裏面搜索 BTREE 找到如下內容
KEY `columnCindex` (`columnC`) USING BTREE
修改爲
KEY `columnCindex` USING BTREE (`columnC`),
然後就可以順利通過了
-------------------------------------------
主要的問題是,數據庫sql文件是mysql5.1的,而實際運行的是mysql5.2的。