sql create table errors MySQL服务器版本

时间:2017-04-16 01:44:35

标签: mysql sql

写一个sql语句在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)

但是错误:

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 个答案:

答案 0 :(得分:1)

这是因为你在这里有两个逗号:

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)