【发布时间】:2015-09-07 12:13:07
【问题描述】:
我添加此行以将 ignore 添加到 MySql 数据库:
ALTER IGNORE cms_books_author name ADD UNIQUE(name)
但我收到此错误:
Error
SQL query:
ALTER IGNORE cms_books_author name ADD UNIQUE(name)
MySQL said: Documentation
#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 'efcms_books_author name ADD UNIQUE(name)' at line 1
Mysql版本为:5.6.20
如何解决这个错误?谢谢。
【问题讨论】:
-
缺表并调整唯一索引的语法:
ALTER IGNORE table cms_books_author ADD UNIQUE(name); -
@amdixon:你说得对。为您添加接受的答案。