我正在从笔记本电脑重新导入一个MySQL数据库到PC。我输出了我的WAMP MySQL .sql
文件,现在正试图将其导入到我的PC上。这一直在过去的工作,我已经因为只有改变周围的情侣对表......但现在我发现了以下错误:好奇的sql导入语法错误
#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 TABLE IF NOT EXISTS `join_quests_npcs` (
`jqn_id` int(6) NOT NULL AUTO_' at line 16
信息:
Desktop WAMP MySQL ver: `5.5.16`,
Laptop WAMP MySQL ver: `5.6.12`
File to import: char set of file: `utf 8`
Format: `sql`
Format-specific options: SQL compatibility mode: `none`
但我不要认为WAMP版本中的这个小差异会导致这样的语法错误。
我也看不出什么毛病就是它的抱怨......这就是它从导出.sql
文件抱怨块我想现在进口:
CREATE TABLE IF NOT EXISTS `join_quests_npcs` (
`jqn_id` int(6) NOT NULL AUTO_INCREMENT,
`quest_id` int(6) NOT NULL,
`npc_id` int(6) NOT NULL,
PRIMARY KEY (`jqn_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;
有什么想法?
谢谢!
编辑:
也好奇:
在.sql
文件中的第一个表是没有问题的产生:
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 27, 2014 at 09:15 PM
-- Server version: 5.6.12-log
-- PHP Version: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @[email protected]@CHARACTER_SET_CLIENT */;
/*!40101 SET @[email protected]@CHARACTER_SET_RESULTS */;
/*!40101 SET @[email protected]@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `my_test_db_2014`
--
CREATE DATABASE IF NOT EXISTS `my_test_db_2014` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `my_test_db_2014`;
-- --------------------------------------------------------
--
-- Table structure for table `gather_items`
--
CREATE TABLE IF NOT EXISTS `gather_items` (
`item_id` int(6) NOT NULL,
`item_name` varchar(100) NOT NULL,
`item_chinese` varchar(100) NOT NULL,
`item_x` int(6) NOT NULL,
`item_y` int(6) NOT NULL,
`item_image` varchar(255) NOT NULL,
`item_total` int(1) NOT NULL,
`item_cost` int(11) NOT NULL,
PRIMARY KEY (`item_id`),
UNIQUE KEY `gather_item_id` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `gather_items`
--
INSERT INTO `gather_items` (`item_id`, `item_name`, `item_chinese`, `item_x`, `item_y`, `item_image`, `item_total`, `item_cost`) VALUES
(1, 'rice', 'fàn', 60, 255, 'data/img/sprite/rice.png', 1, 10),
(2, 'water', 'shui', 30, 400, 'data/img/sprite/poly.png', 3, 40),
(3, 'meat', 'rou', 500, 100, 'data/img/sprite/meat.png', 1, 100);
-- --------------------------------------------------------
在创建该表的错误了:
--
-- Table structure for table `join_quests_npcs`
--
CREATE TABLE IF NOT EXISTS `join_quests_npcs` (
`jqn_id` int(6) NOT NULL AUTO_INCREMENT,
`quest_id` int(6) NOT NULL,
`npc_id` int(6) NOT NULL,
PRIMARY KEY (`jqn_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;
编辑2:
所以我删除join_quest_npcs
创建表,看它是否仍然会抱怨,现在它的再次示数出下面的下一个块...所以我认为这是某种联系的gather_items
第一张桌子的创作。
#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 TABLE IF NOT EXISTS `levels` (
`level_id` int(11) NOT NULL,
`levelnam' at line 17
SQL块:
--
-- Table structure for table `levels`
--
CREATE TABLE IF NOT EXISTS `levels` (
`level_id` int(11) NOT NULL,
`levelname` varchar(255) NOT NULL,
`associatedQuestIDs` varchar(255) NOT NULL,
PRIMARY KEY (`level_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `levels`
--
INSERT INTO `levels` (`level_id`, `levelname`, `associatedQuestIDs`) VALUES
(1, 'mymap', '101 102 103'),
(2, 'mymap2', '201 202');
发行说明的快速检查没有发现任何东西。 – 2014-10-27 20:52:46
@JayBlanchard好想法。然后我完全被难住了。这对我来说通常是常规的输出/输入。 – Growler 2014-10-27 20:56:49
@JayBlanchard你认为编码可以与它有任何关系?我在一些字段中有特殊的字符(中文字符),所以我使用'utf8'。 – Growler 2014-10-27 20:59:06