mysql - sql建表错误MySQL服务器版本

标签 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")

请告诉我原因

最佳答案

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

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)

关于mysql - sql建表错误MySQL服务器版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43432904/

相关文章:

MySQL连接2个表并联合一列

php - 数据存储在json中

mysql - 更新基于 MySQL 表的 DATETIME 列

mysql - SQL语句返回格式错误

mysql - SQL 从帖子中搜索 #hashtag

sql - sql loader命令执行出错如何回滚?

java - 极慢的 Netezza(数据库)批量插入

MySQL 未从计数和外连接中获取零行

mysql - 如何获得 "street number"列中的项目以及 "Occupants"的最小值?

python mysql删除语句不起作用