【问题标题】:#1064 - Error when import database#1064 - 导入数据库时​​出错
【发布时间】:2017-10-23 22:38:03
【问题描述】:

当我导入数据库时​​,我得到这些错误:

CREATE TABLE IF NOT EXISTS `wppo_arf_ar` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `frm_id` int(11) NOT NULL,
  `aweber` text NOT NULL,
  `mailchimp` text NOT NULL,
  `getresponse` text NOT NULL,
  `gvo` text NOT NULL,
  `ebizac` text NOT NULL,
  `icontact` text NOT NULL,
  `constant_contact` text NOT NULL,
  `enable_ar` text,
  PRIMARY KEY (`id`)
) TYPE=MyISAM  AUTO_INCREMENT='11'

MySQL 说:

#1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 13 行的 'TYPE=MyISAM AUTO_INCREMENT='11'' 附近使用正确的语法

【问题讨论】:

    标签: mysql database wordpress


    【解决方案1】:
    AUTO_INCREMENT='11' 
    

    应该是

    AUTO_INCREMENT=11
    

    否则它认为你正在尝试使用字符串 也正如 Damien 所说,发动机类型应该是

    Engine=MyISAM
    

    完整有效的sn-p:

    CREATE TABLE IF NOT EXISTS `wppo_arf_ar` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `frm_id` int(11) NOT NULL,
      `aweber` text NOT NULL,
      `mailchimp` text NOT NULL,
      `getresponse` text NOT NULL,
      `gvo` text NOT NULL,
      `ebizac` text NOT NULL,
      `icontact` text NOT NULL,
      `constant_contact` text NOT NULL,
      `enable_ar` text,
      PRIMARY KEY (`id`)
    ) Engine=MyISAM AUTO_INCREMENT=11
    

    【讨论】:

    • 如果你要使用他的代码,你必须引用作者:)
    【解决方案2】:

    这是正确的语法,MyISAM 是您的表的引擎类型。另一方面,String 不是 Int,并且 AUTO_INCREMENT 具有 Int 类型,所以最终查询如下所示:

      CREATE TABLE IF NOT EXISTS `wppo_arf_ar` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `frm_id` int(11) NOT NULL,
      `aweber` text NOT NULL,
      `mailchimp` text NOT NULL,
      `getresponse` text NOT NULL,
      `gvo` text NOT NULL,
      `ebizac` text NOT NULL,
      `icontact` text NOT NULL,
      `constant_contact` text NOT NULL,
      `enable_ar` text,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  AUTO_INCREMENT = 11
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-11-23
      • 2016-05-18
      • 2017-03-18
      • 2014-10-10
      • 2015-10-03
      • 2013-10-06
      • 2016-10-07
      相关资源
      最近更新 更多