2017-04-16 31 views
0

寫SQL語句在MySQL中SQL CREATE表錯誤的MySQL服務器版本

CREATE TABLE fb_web_user_feeds(id bigint not null primary key auto_increment,host_id bigint,,author varchar(64),time varchar(64),user_feed text) 

創建一個表,但IT的錯誤:

pymysql.err.ProgrammingError: (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 'author varchar(64),time varchar(64),user_feed text)' at line 1") 

你能告訴我原因

回答

1

這是因爲這裏有2個逗號:

host_id bigint,,author varchar(64) 

它應該只是1逗號使您的語法是:

CREATE TABLE fb_web_user_feeds(id bigint not null primary key auto_increment,host_id bigint,author varchar(64),time varchar(64),user_feed text) 
+0

是啊,你是對的 – bin