1
resposta

Não consigo importar o arquivo cap2.sql

Microsoft Windows [versão 10.0.17134.285] (c) 2018 Microsoft Corporation. Todos os direitos reservados.

C:\Users\renan>mysql -uroot -p Enter password: **** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 27 Server version: 8.0.12 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> mysql -u root -p controle_compras < cap2.sql; ERROR 1064 (42000): 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 'mysql -u root -p controle_compras < cap2.sql' at line 1 mysql>

Sempre aparece esse erro, impossibilitando a importação.

1 resposta

Olá Renan, aparentemente você está tentando executar esse comando dentro do MySQL.

É necessário que, no CMD, você esteja dentro do diretório que onde está o seu arquivo cap2.sql.

Não é necessário entrar no MySQL.

Daí nesse diretório, você executa o comando de restauração do banco mysql -u root -p controle_compras < cap2.sql.

Espero que tenha ajudado.