【Java】mysqlインポートでUSING BTREEエラーが発生しました.Check the manual that corresponds to your MySQL server version..

1526 ワード

navicatを使用してテーブルを作成するときにエラーが発生しました
[Err] 1064 - 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 `sort_order` (`sort_order`) ) ENGINE=InnoDB AUTO_INCREMENT=' at line 11
半日探してみたらUSING BTREEにエラーが出ていて、
DROP TABLE IF EXISTS `XX`;
CREATE TABLE `XX` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '  ID',
  `parent_id` bigint(20) DEFAULT NULL COMMENT '   ID=0 ,         ',
  `name` varchar(50) DEFAULT NULL COMMENT '    ',
  `status` int(1) DEFAULT '1' COMMENT '  。   :1(  ),2(  )',
  `sort_order` int(4) DEFAULT NULL COMMENT '    ,           ,             。    :      ',
  `is_parent` tinyint(1) DEFAULT '1' COMMENT '         ,1 true,0 false',
  `created` datetime DEFAULT NULL COMMENT '    ',
  `updated` datetime DEFAULT NULL COMMENT '    ',
  PRIMARY KEY (`id`),
  KEY `parent_id` (`parent_id`,`status`) USING BTREE,
  KEY `sort_order` (`sort_order`)
) ENGINE=InnoDB AUTO_INCREMENT=1183 DEFAULT CHARSET=utf8 COMMENT='    ';
  KEY `parent_id` USING BTREE (`parent_id`,`status`) ,

USING BTREEを前面に置けばいいです.
1.MySQL 5で互換性に問題が発生しました.1でUNIQUE KEYを作成したテーブルをエクスポートするときにKEY`parent_id`(`parent_id`,`status`)USING BTREEのようです.
2.MySQL 5の処理0の場合、KEY`parent_を認識するしかありませんid` USING BTREE (`parent_id`,`status`) ,
MySQL文を実行するには、KEYをフィールドの前に移動します.