日期:2014-05-16  浏览次数:20979 次

MYSQL回复时,错误1064提示


CREATE TABLE /*!32312 IF NOT EXISTS*/ "myip_service" (
  "pid" int(13) unsigned NOT NULL auto_increment,
  "user_id" varchar(255) default NULL COMMENT '?? ???',
  "name" varchar(255) default NULL COMMENT '?? ??',
  "handphone" varchar(255) default NULL COMMENT '?? ??? ???',
  "shipping" varchar(255) default NULL COMMENT '???? [??, ????, ktx]',
  "address" varchar(255) default NULL COMMENT '??? ??',
  "service_code" varchar(255) default NULL COMMENT '????',
  "service_name" varchar(255) default NULL COMMENT '???',
  "service_agreement" varchar(255) default NULL COMMENT '??, ???',
  "static_ip_address" varchar(255) default NULL COMMENT '????? ??',
  "server" varchar(255) default NULL COMMENT 'VPN ?? ??',
  "username" varchar(255) default NULL,
  "password" varchar(255) default NULL,
  "price" int(13) unsigned default NULL COMMENT '?? ?? ??',
  "upload" varchar(255) default NULL COMMENT '??? ??',
  "download" varchar(255) default NULL COMMENT '???? ??',
  "ban_status" varchar(255) default NULL COMMENT '???? [??,??,??, ??]',
  "status" varchar(255) default NULL COMMENT '?? ?? ?? [up,down]',
  "connect_cnt" int(13) unsigned default NULL COMMENT '??? ?? (?? ???)',
  "start_date" datetime default NULL COMMENT '????',
  "end_date" datetime default NULL COMMENT '????',
  "remote_ip" varchar(255) default NULL COMMENT '??? IP',
  "country" varchar(255) default NULL COMMENT '????',
  "auto_status" varchar(255) default NULL COMMENT '??? [on, off]',
  "memo" mediumtext COMMENT '??',
  "mrtg" varchar(255) default NULL COMMENT 'MRTG',
  PRIMARY KEY ("pid"),
  UNIQUE KEY "pid" ("pid"),
  KEY "pid_2" ("pid")
) AUTO_INCREMENT=95 /*!40100 DEFAULT CHARSET=utf8*/;

运行后,提示:
#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 '"myip_service" (
  "pid" int(13) unsigned NOT NULL auto_increment,
  "user_id"' at line 21 


------解决方案--------------------
探讨

不要用双引号。

如果有保留字,使用反引号 `