BrainHappy BrainHappy - 2 months ago 8
MySQL Question

Importing SQL Query server-side error

I receive this error when I try to upload my SQL data in my new server:

SQL query:

--
-- Database: `dacwp0_brainhappy_ca`
--
`dacwp0_brainhappy_ca` ;

MySQL said: 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 '`dacwp0_brainhappy_ca`' at line 4


The beginning of my imported .sql file

-- phpMyAdmin SQL Dump
-- version v0.1-int.sec.2.10.0.2
-- http://www.phpmyadmin.net
--
-- Host: shiku
-- Generation Time: Sep 22, 2016 at 10:48 PM
-- Server version: 5.1.66
-- PHP Version: 5.3.29

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `dacwp0_brainhappy_ca`
--
`dacwp0_brainhappy_ca`;


I'm seriously at a loss of what to do. Any mySQL gurus on here?

Answer

I think you meant to use the said database and in that case you are missing the use keyword before database name to use the stated database. It should be

use `dacwp0_brainhappy_ca`;

See MySQL Documentation On USE Syntax for more information