SQL - Import data from a file

0

Hello, how are friends?

I'm having a problem importing a previously created table:

The following return message when I try to perform the import in MySQL:

Static analysis:

  

3 errors were found during analysis.

     

Unexpected character. (near ":" at position 4)

     

Unexpected character. (near ":" at position 25)

     

Unrecognized statement type. (near "Host" at position 0)   SQL command: 'Host: localhost (Version: 5.5.27)

     

/ *! 40101 SET> @OLD_CHARACTER_SET_CLIENT = @@ CHARACTER_SET_CLIENT * /

MySQL Messages: Documentation

  

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 'Host: localhost (Version: 5.5.27)

     

/ *! 40101 SET @OLD_CHARACTER_SET_CLIENT = @@ C 'at line 1 "

I'd like to know what I can do to make the import complete in a positive way.

I'll be waiting, thanks!

    
asked by anonymous 18.01.2017 / 04:18

1 answer

0

I did it, I did the following process:

First I created the table: 'cad_client'

After that I clicked on SQL and pasted the following code:

CREATE TABLE 'cad_cliente' (
  'cd_cliente' int(10) NOT NULL AUTO_INCREMENT,
  'ds_cliente' varchar(255) DEFAULT NULL,
  'nr_cnpjcpf' varchar(50) DEFAULT NULL,
  'nr_ident' varchar(50) DEFAULT NULL,
  'ds_contato' varchar(200) DEFAULT NULL,
  'nr_ddd' char(3) DEFAULT NULL,
  'nr_telefone' varchar(15) DEFAULT NULL,
  'email' varchar(50) DEFAULT NULL,
  'ds_endereco' varchar(50) DEFAULT NULL,
  'ds_complemento' varchar(50) DEFAULT NULL,
  'ds_bairro' varchar(50) DEFAULT NULL,
  'ds_cidade' varchar(50) DEFAULT NULL,
  'ds_estado' varchar(50) DEFAULT NULL,
  'nr_cep' varchar(9) DEFAULT NULL,
  'ds_razao' varchar(100) DEFAULT NULL,
  'tp_cliente' char(1) DEFAULT 'f',
  PRIMARY KEY ('cd_cliente')
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;

After creating the tables, paste the following code:

INSERT INTO 'cad_cliente' VALUES (16,'spacetec','2222222222222',NULL,'pedro','21','22530548','[email protected]','av rio branco','37 1502','centro','rio de janeiro','RJ','24320000','spacetec soluçoes tecnologicas','j');

Then I created the table 'users'

I clicked on SQL and pasted the code below:

CREATE TABLE 'usuarios' (
  'usuario_id' int(5) NOT NULL AUTO_INCREMENT,
  'nome' varchar(50) COLLATE latin1_general_ci NOT NULL DEFAULT '',
  'sobrenome' varchar(50) COLLATE latin1_general_ci NOT NULL DEFAULT '',
  'email' varchar(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
  'usuario' varchar(32) COLLATE latin1_general_ci NOT NULL DEFAULT '',
  'senha' varchar(32) COLLATE latin1_general_ci NOT NULL DEFAULT '',
  'info' text COLLATE latin1_general_ci NOT NULL,
  'nivel_usuario' enum('0','1','2') COLLATE latin1_general_ci NOT NULL DEFAULT '0',
  'data_cadastro' datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  'data_ultimo_login' datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  'ativado' enum('0','1') COLLATE latin1_general_ci NOT NULL DEFAULT '0',
  PRIMARY KEY ('usuario_id')
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

I repeated the process of inserting the data that was registered in my backup.

So I just separated each part of the process, it worked perfectly.

    
18.01.2017 / 17:54