2017-04-16 43 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

相关问题