mysql 错误 1064

2022-01-05 00:00:00 sql mysql phpmyadmin mysql-error-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'),后的逗号

相关文章