user3397776
user3397776

Reputation: 19

Mysql 1064(4200) error shows up when I tried to create a table

-CREATE TABLE accesslogs (
page VARCHAR(250) NOT NULL,
userid VARCHAR(8) BINARY NOT NULL,
visitcount MEDIUMINT(5) DEFAULT 0 NOT NULL,
accessdate TIMESTAMP(14),
PRIMARY KEY (userid, page));

After I press enter from the command line and error is shown:

-ERROR 1064 (4200): 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), PRIMARY KEY (userid, page)'
at line 5.

This error keeps on occurring every time I try to create the table after flushing the privileges.

Please help.

Thanks

Upvotes: 0

Views: 208

Answers (1)

Barmar
Barmar

Reputation: 782056

Change:

accessdate TIMESTAMP(14),

to

accessdate TIMESTAMP,

The TIMESTAMP data type doesn't have a size option.

Upvotes: 2

Related Questions