Sheenah
Sheenah

Reputation: 85

Syntax Error in MySQL on Ubuntu

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that coresponds to your MySQL server version for the right syntax to use near ')' at line 4

CREATE TABLE esk (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
UserID INT,
FileID INT,
Key TEXT);

Where is the error? Server version is 5.5.38-0ubuntu0.12.04.1 (Ubuntu)

Upvotes: 0

Views: 472

Answers (1)

radar
radar

Reputation: 13425

KEY is a reserved key word

use ` back ticks

CREATE TABLE esk (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
UserID INT,
FileID INT,
`Key` TEXT);

Upvotes: 1

Related Questions