0
I am trying to restore a DBS I have on my machine, but unfortunately I am having problems...
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 -h localhost -p reg_users < /home/ubuntu/workspace/restore.sql' at line 1
this is the error that is returning, please help me
My DBS(Restore.SQL)...
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 05/05/2017 às 18:41
-- Versão do servidor: 5.7.17
-- Versão do PHP: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Banco de dados: `reg_users`
--
-- --------------------------------------------------------
--
-- Estrutura para tabela `user_civ`
--
CREATE TABLE `user_civ` (
`nome` varchar(100) NOT NULL,
`usuario` varchar(100) NOT NULL,
`senha` varchar(100) NOT NULL,
`edereco` varchar(200) NOT NULL,
`userCivCod` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estrutura para tabela `user_ong`
--
CREATE TABLE `user_ong` (
`nome` varchar(100) NOT NULL,
`nome_ong` varchar(100) NOT NULL,
`senha` varchar(100) NOT NULL,
`userOngCod` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Índices de tabelas apagadas
--
--
-- Índices de tabela `user_civ`
--
ALTER TABLE `user_civ`
ADD PRIMARY KEY (`userCivCod`);
--
-- Índices de tabela `user_ong`
--
ALTER TABLE `user_ong`
ADD PRIMARY KEY (`userOngCod`);
--
-- AUTO_INCREMENT de tabelas apagadas
--
--
-- AUTO_INCREMENT de tabela `user_civ`
--
ALTER TABLE `user_civ`
MODIFY `userCivCod` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de tabela `user_ong`
--
ALTER TABLE `user_ong`
MODIFY `userOngCod` int(11) NOT NULL AUTO_INCREMENT;COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Dude, the bug already says, 'syntax error,' I suggest you post what you think is happening(code) here.
– Alex
what else can I post? my DBS? what code? refers to the command used? if it is already in the post, but I will comment here tbm "mysql -u root -h localhost -p reg_users < /home/Ubuntu/Workspace/Restore.sq"
– Jefter Rocha
Put the
Restore.SQL
, because I ran the command on my mysql and it worked– Aprendiz
This command you mentioned above needs to be run via the command line. Is that what you’re doing? By the error message, it seems that you are trying to run it as if it were a query.
– bfavaretto