我正在尝试使用以下代码创建表:
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
我不知道发生了什么,有什么建议吗?
UNIQUE KEY 'atom_id' ('atom_id'),在第11行后删除逗号
UNIQUE KEY 'atom_id' ('atom_id'),