CREATE TABLE IF NOT EXISTS `cj_admin` ( `USERID` int(11) NOT NULL AUTO_INCREMENT, `USERNAME` varchar(20) DEFAULT "", `USERPASSWORD` varchar(32) NOT NULL DEFAULT "", `delete_password` varchar(32) NOT NULL DEFAULT "", `NICKNAME` varchar(50) NOT NULL DEFAULT "", `USERTYPE` varchar(50) NOT NULL DEFAULT "", `PhoneNumber` varchar(15) NOT NULL DEFAULT "", `LOGINTIME` int(11) NOT NULL DEFAULT "0", `LOGINIP` varchar(15) DEFAULT NULL, `LOGINNUM` int(11) NOT NULL DEFAULT "0", `REGTIME` int(11) NOT NULL DEFAULT "0", `REGIP` varchar(15) DEFAULT NULL, `USERIS` tinyint(1) NOT NULL DEFAULT "0", `actions` mediumtext, `role` tinyint(2) unsigned NOT NULL DEFAULT "1", `free_time` varchar(255) DEFAULT "2", `scene_times` varchar(255) DEFAULT "2", `user_id` int(10) unsigned DEFAULT "0", PRIMARY KEY (`USERID`), KEY `USERID` (`USERID`) USING BTREE ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
报错。#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 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10” at line 21
10
KEY `USERID` (`USERID`) USING BTREE
改成
KEY `USERID` USING BTREE (`USERID`)
10
本人在本人的mysql数据库试过,两个都可以,而且
CREATE TABLE IF NOT EXISTS `cj_admin` (
`USERID` int(11) NOT NULL AUTO_INCREMENT,
`USERNAME` varchar(20) DEFAULT “”,
`USERPASSWORD` varchar(32) NOT NULL DEFAULT “”,
`delete_password` varchar(32) NOT NULL DEFAULT “”,
`NICKNAME` varchar(50) NOT NULL DEFAULT “”,
`USERTYPE` varchar(50) NOT NULL DEFAULT “”,
`PhoneNumber` varchar(15) NOT NULL DEFAULT “”,
`LOGINTIME` int(11) NOT NULL DEFAULT “0”,
`LOGINIP` varchar(15) DEFAULT NULL,
`LOGINNUM` int(11) NOT NULL DEFAULT “0”,
`REGTIME` int(11) NOT NULL DEFAULT “0”,
`REGIP` varchar(15) DEFAULT NULL,
`USERIS` tinyint(1) NOT NULL DEFAULT “0”,
`actions` mediumtext,
`role` tinyint(2) unsigned NOT NULL DEFAULT “1”,
`free_time` varchar(255) DEFAULT “2”,
`scene_times` varchar(255) DEFAULT “2”,
`user_id` int(10) unsigned DEFAULT “0”,
PRIMARY KEY (`USERID`),
KEY `USERID` (`USERID`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
语句没有出现错误。LZ是什么版本?