mysql 错误 1064 [英] mysql error 1064

查看:35
本文介绍了mysql 错误 1064的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用此代码创建一个表:

Im trying to create a table with this code:

CREATE TABLE IF NOT EXISTS `entries` (
  `id` int(10) NOT NULL auto_increment,
  `atom_id` varchar(512) NOT NULL,
  `title` varchar(256) NOT NULL,
  `author` varchar(128) NOT NULL,
  `link` varchar(512) NOT NULL,
  `content` longtext NOT NULL,
  `updated` varchar(25) NOT NULL,
  `inserted` varchar(25) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `atom_id` (`atom_id`),
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `topics` (
  `id` int(10) NOT NULL auto_increment,
  `status` varchar(32) NOT NULL,
  `hub` varchar(512) NOT NULL,
  `topic` varchar(512) NOT NULL,
  `lease` varchar(25) NOT NULL,
  `secret` varchar(256) NOT NULL,
  `token` varchar(40) NOT NULL,
  `date` varchar(25) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

但我收到此错误:

#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 ') ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1' at line 12 

我不知道发生了什么,有什么建议吗?

I can't figure what's going on, any advice?

推荐答案

去掉第11行UNIQUE KEY 'atom_id'('atom_id'),后的逗号

这篇关于mysql 错误 1064的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆