Error #1064 MySQL Something is wrong in your syntax near '' accesslogh '

Advertisements

I got this MySQL error 1064:

# 1064 - Something is wrong in your syntax near '' accesslogh '(
id INT (30) PRIMARY KEY AUTO_INCREMENT NOT NULL,
nam ... 'on line 1

When i ran

CREATE TABLE 'accesslogh' (
id INT(30) PRIMARY KEY AUTO_INCREMENT NOT NULL, 
name VARCHAR(255), 
result VARCHAR(255), 
type VARCHAR(255), 
code VARCHAR(255), 
epoch INT(30), 
timestamp DATE DEFAULT CURRENT_TIMESTAMP);

I know it is a syntax error but I have tried to solve it following the correct theory but I can’t solve it. Help me pls.

>Solution :

Remove quotes around table name.

CREATE TABLE accesslogh (
id INT(30) PRIMARY KEY AUTO_INCREMENT NOT NULL, 
name VARCHAR(255), 
result VARCHAR(255), 
type VARCHAR(255), 
code VARCHAR(255), 
epoch INT(30), 
timestamp DATE DEFAULT CURRENT_TIMESTAMP);

Leave a ReplyCancel reply