不能在同一台服务器上使用phpmyadmin export / import复制mysql数据库

时间:2016-09-12 23:44:05

标签: mysql drupal phpmyadmin

我正在尝试在远程bluehost服务器上复制我的一个数据库,以便为我的drupal网站设置开发和舞台环境。 Dev已经设置/填充并且工作正常,所以我现在只是尝试复制dev数据库。在Windows上使用phpmyadmin(PHP 5.2.17,MySQL 5.5.42)。我已完成以下步骤:

  1. 创建了site_stage数据库
  2. 将site_dev db中的所有表导出/转储到压缩的sql.gz文件中
  3. 将所有表导入site_stage db
  4. 导入失败,错误为$ 1064:

    INSERT INTO `cache_bootstrap` (`cid`, `data`, `expire`, `created`, `serialized`, `tags`, `checksum`) VALUES
    ('system_list', 0x613a323a7b733a353a227468656d65223b613a31333a7b733a363a2262617274696b223b433a33313a2244727570616c5c436f72655c457874656e73696f6e5c457874656e73696f6e223a323339343a7b613a31363a7b733a343a2274797065223b733a353a227468656d65223b733a383a22706174686e616d65223b733a33343a22636f72652f7468656d65732f62617274696b2f62617274696b2e696e666f2e796d6c223b733a383a2266696c656e616d65223b733a31323a2262617274696b2e7468656d65223b733a373a2273756270617468223b733a31333a227468656d65732f62617274696b223b733a363a226f726967696e223b733a343a22636f7265223b733a363a22737461747573223b693a313b733a343a22696e666f223b613a31393a7b733a343a226e616d65223b733a363a2242617274696b223b733a343a2274797065223b733a353a227468656d65223b733a31303a2262617365207468656d65223b733a363a22636c61737379223b733a31313a226465736372697074696f6e223b733a38363a224120666c657869626c652c207265636f6c6f7261626c65207468656d652077697468206d616e79[...]
    
    #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 '?' at line 2 
    

    想想也许它不喜欢那个值的长度,所以我只是从未压缩版本的转储文件中删除了cache_bootstrap查询(反正不应该需要这个缓存表)并尝试再次导入,这次,它失败了出现以下错误:

    CREATE TABLE IF NOT EXISTS `key_value` (
      `collection` varchar(128) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT 'A named collection of key and value pairs.'
    `value` longblob NOT NULL COMMENT 'The value.',
      PRIMARY KEY (`collection`,`name`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Generic key-value storage table. See the state system for…';
    
    #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 '`value` longblob NOT NULL COMMENT 'The value.',
      PRIMARY KEY (`collection`,`nam' at line 9 
    

    我已经阅读了很多'导入'线程上的'1064错误,但它们都没有帮助,而且大多数都与在服务器之间移动sql数据有关。非常奇怪的是,我会在同一台服务器上将表从一个数据库复制到另一个数据库,使用相同的mysql版本等语法错误。任何想法?谢谢你。

0 个答案:

没有答案