CREATE TABLE `t_academy` ( `academy_id` int(11) NOT NULL AUTO_INCREMENT, `academy` varchar(20) DEFAULT NULL, PRIMARY KEY (`academy_id`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《
[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 '01
CREATE TABLEt_academy
(academy_id
int(11) NOT NULL AUTO_INCREME' at line 1
在我自己的机器上测试是可以的:
CREATE TABLE
t_academy
(academy_id
int(11) NOT NULL AUTO_INCREMENT,academy
varchar(20) DEFAULT NULL,PRIMARY KEY (
academy_id
)) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.00 sec)
最可能的原因是字符问题,检查标点是不是中文模式下的,有没有多余的字符或者乱起八糟不可见的字符。
academy_id
int(11) NOT NULL AUTO_INCREMENT,这里补上primary key单独测试没有语法错误。。不信你单独开个查询窗口试试。。