- 论坛徽章:
- 0
|
有shelter.sql文件如下,我想把它导入到MySQL中去,工具是phpMyAdmin
/////////////////////////////////////////////////////////////////////////////////////////////////////////
-- shelter.sql
-- MySQL dump 9.11
--
-- Host: localhost Database: Shelter
-- ------------------------------------------------------
-- Server version 4.0.23-standard-log
---
--- Create the database
---
DROP DATABASE IF EXISTS Shelter;
CREATE DATABASE Shelter;
USE Shelter;
--
-- Table structure for table `tCat`
--
DROP TABLE IF EXISTS tCat;
CREATE TABLE tCat (
CatID int(11) NOT NULL auto_increment,
Name varchar(40) NOT NULL default '',
Gender char(1) NOT NULL default 'U',
Age int(3) NOT NULL default '0',
Breed varchar(100) NOT NULL default '',
PRIMARY KEY (CatID)
) TYPE=MyISAM;
--
-- Dumping data for table `tCat`
--
INSERT INTO tCat (CatID, Name, Gender, Age, Breed) VALUES (1,'Snowball','M',145,'DSH');
INSERT INTO tCat (CatID, Name, Gender, Age, Breed) VALUES (2,'Lizzie','F',141,'DSH/Siamese Mix');
INSERT INTO tCat (CatID, Name, Gender, Age, Breed) VALUES (3,'Pim Pim','F',120,'DSH/Russian Blue Mix');
INSERT INTO tCat (CatID, Name, Gender, Age, Breed) VALUES (4,'Mathilda','F',37,'DMH');
INSERT INTO tCat (CatID, Name, Gender, Age, Breed) VALUES (5,'Manfred','M',18,'DSH');
INSERT INTO tCat (CatID, Name, Gender, Age, Breed) VALUES (6,'Saffy','F',108,'DLH');
INSERT INTO tCat (CatID, Name, Gender, Age, Breed) VALUES (7,'Tera','F',60,'DSH');
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
但是phpMyAdmin提示如下错误信息:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
错误
SQL 查询:
-- MySQL dump 9.11
--
-- Host: localhost Database: Shelter
-- ------------------------------------------------------
-- Server version 4.0.23-standard-log
- --
- -- Create the database
- --
DROP DATABASE IF EXISTS Shelter;
MySQL 返回:
#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 '---
--- Create the database
---
DROP DATABASE IF EXISTS Shelter' at line 1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
我看了一下shelter中的语法也没错,不知道问题可能出在什么地方.
我的MySQL版本是5.0
大家帮我看看是什么原因?
[ 本帖最后由 jianjun 于 2006-10-20 11:57 编辑 ] |
|