简体   繁体   中英

Error# 1064 when trying to add table

trying to import an old script from a website I used, and am having issues when importing the tables from the script. I got most of the script to work after a little bit of google'ing and mostly coming to this site. Here is the part that isn't working:

CREATE TABLE calendar_events ( 
id int(11) NOT NULL auto_increment, 
timestamp timestamp(14) NOT NULL, 
title varchar(255) NOT NULL default '', 
description text NOT NULL, 
url varchar(100) NOT NULL default '', 
email varchar(120) NOT NULL default '', 
cat tinyint(2) NOT NULL default '0', 
starttime varchar(8) NOT NULL default '', 
endtime varchar(8) NOT NULL default '', 
day tinyint(2) NOT NULL default '0', 
month smallint(2) NOT NULL default '0', 
year smallint(4) NOT NULL default '0', 
approved tinyint(1) NOT NULL default '0', 
priority tinyint(1) NOT NULL default '0', 
user varchar(30) NOT NULL default '', 
timezone varchar(5) NOT NULL default '', 
PRIMARY KEY (id),
) ENGINE=MyISAM;

Note: I have already changed the TYPE=MyISAM; to ENGINE=MyISAM; and have already tried to run it with and without the UNIQUE KEY id (id).

No matter what I try, I always get the following error:

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 '(14) NOT NULL, title varchar(255) NOT NULL default '', description text NOT NU' at line 3

timestamp(14)

卸下(14)。时间戳记没有大小。

i changed it for you dude , just use it :

CREATE TABLE calendar_events ( 
id int(11) NOT NULL auto_increment, 
timestamp timestamp  NOT NULL, 
title varchar(255) NOT NULL default '', 
description text NOT NULL, 
url varchar(100) NOT NULL default '', 
email varchar(120) NOT NULL default '', 
cat tinyint(2) NOT NULL default '0', 
starttime varchar(8) NOT NULL default '', 
endtime varchar(8) NOT NULL default '', 
day tinyint(2) NOT NULL default '0', 
month smallint(2) NOT NULL default '0', 
year smallint(4) NOT NULL default '0', 
approved tinyint(1) NOT NULL default '0', 
priority tinyint(1) NOT NULL default '0', 
user varchar(30) NOT NULL default '', 
timezone varchar(5) NOT NULL default '', 
PRIMARY KEY (id) 
) ENGINE=MyISAM;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM