将sql移动到另一台服务器时出现语法错误

时间:2015-08-12 07:50:37

标签: mysql sql phpmyadmin

我试图通过PHPMyAdmin将我的sql文件从一个主机导入到另一个主机。 托管一个(导出托管商)有以下规格(我猜这些问题?)

Database server

Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.6.23-log - MySQL Community Server (GPL)
Protocol version: 10
User: abonne1q@localhost
Server charset: UTF-8 Unicode (utf8)

Web server

cpsrvd 11.50.0.29
Database client version: libmysql - 5.1.73
PHP extension: mysqli 

phpMyAdmin
Version information: 4.0.10.7, latest stable version: 4.4.13.1

现在我尝试将sql文件移动到的新主机具有以下规范

Database server

Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.5.31 - MySQL Community Server (GPL)
Protocol version: 10
User: goedkope_refills@localhost
Server charset: UTF-8 Unicode (utf8)

Web server

Apache/2
Database client version: libmysql - mysqlnd 5.0.11-dev - 20120503 - $Id: 15d5c781cfcad91193dceae1d2cdd127674ddb3e $
PHP extension: mysqli Documentation
PHP version: 5.5.28

phpMyAdmin

Version information: 4.4.13, latest stable version: 4.4.13.1

当我从hoster 1导出sql并尝试将其导入到hoster 2时,我收到如下语法错误 enter image description here

我尝试了很多东西,并尝试联系主机,但没有运气。任何人都有线索?

SQL查询非常庞大,但这里是包含错误的查询:

-- phpMyAdmin SQL Dump
-- version 4.0.10.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 12, 2015 at 09:39 AM
-- Server version: 5.6.23-log
-- PHP Version: 5.4.31

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;

--
-- Database: `abonne1q_fotograafhuren`
--

-- --------------------------------------------------------

--
-- Table structure for table `wp_app_geodata`
--

CREATE TABLE IF NOT EXISTS `wp_app_geodata` (
  `post_id` bigint(20) unsigned NOT NULL,
  `lat` decimal(10,6) NOT NULL,
  `lng` decimal(10,6) NOT NULL,
  PRIMARY KEY (`post_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `wp_app_geodata`
--

INSERT INTO `wp_app_geodata` (`post_id`, `lat`, `lng`) VALUES
(9, '0.000000', '0.000000'),
(126, '52.239338', '6.112210'),
(162, '0.000000', '0.000000'),
(165, '52.239338', '6.112210'),
(168, '0.000000', '0.000000'),
(171, '52.239338', '6.112210'),
(187, '0.000000', '0.000000'),
(191, '52.239338', '6.112210'),
(198, '52.239338', '6.112210'),
(216, '52.239338', '6.112210'),
(254, '52.341252', '4.853872'),
(286, '52.346514', '4.895257'),
(295, '0.000000', '0.000000'),
(314, '52.239338', '6.112210'),
(420, '52.239338', '6.112210'),
(425, '0.000000', '0.000000'),
(437, '0.000000', '0.000000'),
(442, '52.266096', '6.216935'),
(444, '0.000000', '0.000000'),
(446, '0.000000', '0.000000'),
(447, '52.254989', '6.177624'),
(449, '52.254989', '6.177624'),
(452, '0.000000', '0.000000'),
(455, '52.254989', '6.177624'),
(458, '0.000000', '0.000000'),
(459, '0.000000', '0.000000'),
(462, '0.000000', '0.000000'),
(466, '0.000000', '0.000000'),
(499, '0.000000', '0.000000'),
(502, '0.000000', '0.000000'),
(505, '0.000000', '0.000000'),
(507, '0.000000', '0.000000'),
(509, '0.000000', '0.000000'),
(510, '0.000000', '0.000000'),
(511, '0.000000', '0.000000'),
(512, '0.000000', '0.000000'),
(513, '52.254989', '6.177624'),
(514, '0.000000', '0.000000'),
(515, '0.000000', '0.000000'),
(516, '0.000000', '0.000000'),
(517, '52.239338', '6.112210'),
(518, '52.237554', '6.098140'),
(519, '0.000000', '0.000000'),
(522, '0.000000', '0.000000'),
(524, '0.000000', '0.000000'),
(525, '0.000000', '0.000000'),
(542, '0.000000', '0.000000'),
(545, '0.000000', '0.000000'),
(548, '52.239338', '6.112210'),
(551, '0.000000', '0.000000');

-- --------------------------------------------------------

--
-- Table structure for table `wp_commentmeta`
--

CREATE TABLE IF NOT EXISTS `wp_commentmeta` (
  `meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `comment_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  `meta_key` varchar(255) DEFAULT NULL,
  `meta_value` longtext,
  PRIMARY KEY (`meta_id`),
  KEY `comment_id` (`comment_id`),
  KEY `meta_key` (`meta_key`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `wp_comments`
--

CREATE TABLE IF NOT EXISTS `wp_comments` (
  `comment_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `comment_post_ID` bigint(20) unsigned NOT NULL DEFAULT '0',
  `comment_author` tinytext NOT NULL,
  `comment_author_email` varchar(100) NOT NULL DEFAULT '',
  `comment_author_url` varchar(200) NOT NULL DEFAULT '',
  `comment_author_IP` varchar(100) NOT NULL DEFAULT '',
  `comment_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `comment_date_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `comment_content` text NOT NULL,
  `comment_karma` int(11) NOT NULL DEFAULT '0',
  `comment_approved` varchar(20) NOT NULL DEFAULT '1',
  `comment_agent` varchar(255) NOT NULL DEFAULT '',
  `comment_type` varchar(20) NOT NULL DEFAULT '',
  `comment_parent` bigint(20) unsigned NOT NULL DEFAULT '0',
  `user_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`comment_ID`),
  KEY `comment_post_ID` (`comment_post_ID`),
  KEY `comment_approved_date_gmt` (`comment_approved`,`comment_date_gmt`),
  KEY `comment_date_gmt` (`comment_date_gmt`),
  KEY `comment_parent` (`comment_parent`),
  KEY `comment_author_email` (`comment_author_email`(10))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `wp_cpk_wpcsv_export_queue`
--

CREATE TABLE IF NOT EXISTS `wp_cpk_wpcsv_export_queue` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `post_id` int(11) NOT NULL,
  `done` tinyint(1) NOT NULL DEFAULT '0',
  `msg` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

2 个答案:

答案 0 :(得分:0)

这似乎是phpmyadmin的一些错误。 HeidiSQL做了这个伎俩!

答案 1 :(得分:0)

我通常会在导入MySQL时删除所有注释,尤其是这部分: -

/*!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 */;

这通常可以解决导入问题。