Skip navigation links

MySQL Forums :: Newbie :: Trying to import SQL script file into MySQL5.1


Advanced Search

Trying to import SQL script file into MySQL5.1
Posted by: Subir Mukherjee ()
Date: February 23, 2010 09:03AM

Hi:

I am logged in to the command prompt interface @ mysql>

Username is: root
Database name is: mysql
Script file that I am trying to import is: dump.sql
Then at command prompt, I use
mysql> mysql -u root -p mysql< dump.sql

I keep getting the error ERROR 1064 <42000>; You have an error in the SQL syntax. Check the manual.......bla bla

FYI, the script file that I am trying to import is attached below
<code>

CREATE DATABASE IF NOT EXISTS `mysql` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE mysql;
-- MySQL dump 10.13 Distrib 5.1.40, for Win32 (ia32)
--
-- Host: localhost Database: mysql
-- ------------------------------------------------------
-- Server version 5.1.42-community

/*!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 utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `validmembers`
--

DROP TABLE IF EXISTS `validmembers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `validmembers` (
`whichsectionofhome` varchar(2000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
`membername` varchar(2000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `validmembers`
--

LOCK TABLES `validmembers` WRITE;
/*!40000 ALTER TABLE `validmembers` DISABLE KEYS */;
INSERT INTO `validmembers` VALUES ('Mansard Roof','Asphalt'),('Mansard Roof','Metal Shingles');
/*!40000 ALTER TABLE `validmembers` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2010-02-22 13:44:31

<code>

Appreciate your help in debugging this issue of mine.

Thank you
Subir



Edited 1 time(s). Last edit at 02/23/2010 09:16AM by Subir Mukherjee.

Options: ReplyQuote


Subject Written By Posted
Trying to import SQL script file into MySQL5.1 Subir Mukherjee 02/23/2010 09:03AM
Re: Trying to import SQL script file into MySQL5.1 Peter Brawley 02/23/2010 01:13PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.