1064 - You have an error in your SQL syntax; check the manual that corresponds

错误信息:

[color=red]mysql> DROP INDEX idx-ipt ON sf_ipt_exam_item;
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 '-ipt ON sf_ipt_exam_item' at line 1
mysql> [/color]

错误原因是语法问题,SQL语句中存在'-'符号,需要用'`'包裹,正确语法如下:

[color=blue]mysql> DROP INDEX `idx-ipt` ON `sf_ipt_exam_item`;
Query OK, 0 rows affected
Records: 0 Duplicates: 0 Warnings: 0

mysql>[/color]

MySQL查询索引语句:
SHOW INDEX FROM `sf_ipt_exam_item`

你可能感兴趣的:(MySQL)