Got MySQL Error #1064 on a simple insert, What am I doing wrong?

80 views Asked by At

I need some help, I'm getting error 1064 when I try to insert data into a table!

INSERT INTO areas (Nombre) values ('area 1');

Table:

CREATE TABLE Areas (
    Id INT PRIMARY KEY AUTO_INCREMENT,
    Nombre VARCHAR(100) UNIQUE NOT NULL
);

What's wrong?

2

There are 2 answers

3
Paul Michael On

It's because you used areas instead of Areas.

3
Zafar Malik On

Your server configuration seems case sensitive so areas and Areas will be 2 tables.

try below-

INSERT INTO Areas (Nombre) VALUES ('area 1');

If you want to take care it then update below variable in your my.cnf or my.ini file.

lower_case_table_names = 1