MySQL错误1064表创建

时间:2017-07-09 18:37:59

标签: mysql syntax-error mysql-error-1064

这似乎是一个相当微不足道的问题,但我在运行以下查询时没有运气:

create table if not exists tweet_data (
created_at DATETIME,
user_name VARCHAR(20),
retweet_count INT,
favourite_count INT,
tweet_followers_count INT,
is_retweet BOOLEAN,
tweet_source VARCHAR(256),
user_location VARCHAR(256),
tweet_mentioned_count INT,
tweet_ID VARCHAR(256) NOT NULL,
tweet_text VARCHAR(140),
UNIQUE (tweet_ID) );

当我运行此命令时,我收到以下错误消息:

Error Code: 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 '(20),  retweet_count INT,     favourite_count INT,     
tweet_followers_count ' at line 3

当我将鼠标悬停在第3行的错误代码上时,它会显示:

Syntax error : unexpected '(' (opening parenthesis)

我确定这是一个简单的修复,任何帮助都会很棒!

2 个答案:

答案 0 :(得分:0)

create table if not exists  tweet_data (

created_at DATETIME,

user_name VARCHAR (20),

retweet_count INT,

favourite_count INT,

tweet_followers_count INT,

is_retweet BOOLEAN,

tweet_source VARCHAR(256),

user_location VARCHAR(256),

tweet_mentioned_count INT,

tweet_ID VARCHAR(256) NOT NULL,

tweet_text VARCHAR(140),

UNIQUE (tweet_ID) );

这个代码运行得很好。

转到此链接并自行检查

http://rextester.com/l/mysql_online_compiler

答案 1 :(得分:0)

原来是mySQL Workbench的错误

相关问题