mysql表创建时的烦人的bug

时间:2013-03-26 21:16:00

标签: mysql database

大家好,我有以下语句,我想用它来创建一个mysql表。

CREATE TABLE `users` (  
`UserID` INT(25) NOT NULL AUTO_INCREMENT PRIMARY KEY ,  
`Username` VARCHAR(65) NOT NULL ,  
`Password` VARCHAR(32) NOT NULL ,  
`EmailAddress` VARCHAR(255) NOT NULL  
);  
CREATE TABLE `profile` (
`UserID` INT(25) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`Username` VARCHAR(65) NOT NULL ,
`Position1` VARCHAR(65) NOT NULL ,
`Position2` VARCHAR(65) NOT NULL ,
`Position3` VARCHAR(65) NOT NULL ,
`champion1` VARCHAR(65) NOT NULL ,
`champion2` VARCHAR(65) NOT NULL ,
`champion3` VARCHAR(65) NOT NULL ,
`Level` INT(2) NOT NULL,
`League` VARCHAR(65) NOT NULL ,
`Leaguename` VARCHAR(65) NOT NULL,
`lolking` VARCHAR(65) NOT NULL,
`Bio` VARCHAR(140) NOT NULL,
);

但它没有这样做并给我错误信息:

ERROR 1064 (42000) at line 8: 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 ')' at line 16

2 个答案:

答案 0 :(得分:5)

摆脱最后一个逗号

`Bio` VARCHAR(140) NOT NULL

答案 1 :(得分:2)

你有一个逗号","它不应该是:

 `Bio` VARCHAR(140) NOT NULL,
 );