Error to import mysql table into phpmyadmin

Asked

Viewed 654 times

0

I have a problem to import a table in phpmyadmin.

Table:

CREATE TABLE ManterEmpresa ( 

  IdEmpresa INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,

  CNPJ INTEGER UNSIGNED NOT NULL,

  NomeEmpresa VARCHAR(45) NOT NULL,

  Logo VARCHAR(45) NOT NULL,

  Descricao VARCHAR(45) NOT NULL,

  Endereco VARCHAR(45) NOT NULL,

  Telefone VARCHAR(45) NOT NULL,

)
ENGINE = INNODB;

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 ')ENGINE = INNODB' at line 9

How can I solve this problem of mine ?

  • 1

    In Telefone VARCHAR(45) NOT NULL, remove the comma.

1 answer

2


That line

Telefone VARCHAR(45) NOT NULL,

should be

Telefone VARCHAR(45) NOT NULL
  • 1

    I would also define the Id as a primary key.

  • @Caiofelipepera me too, but this has nothing to do with the mistake.

  • Not with this error, but setting an auto increment without a PK fires a 1075. I think it would be a good complement to the answer

  • thanks for the help, it worked

  • @Ewertonsimonetto you can vote positively in the answers and also choose the one that solved your problem by marking the sign below the arrows to vote.

  • @Caiofelipepereira He may have decreased the script to put here. It is possible to define a index as auto_increment, even if it’s not primary key

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.