从 table 中删除索引

Drop indexing from a table

我想从 table "Regions"

的 2 个字段 "title" 和 "cycle" 中删除索引

这是我的 table 结构及其中的字段

SHOW COLUMNS from Regions

 +------------+--------------+------+-----+---------+-------+
| Field      | Type         | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| id         | int(10)      | NO   | MUL | 0       |       |
| first      | int(10)      | NO   | MUL | 0       |       |
| last       | int(10)      | NO   | MUL | 0       |       |
| title      | varchar(200) | YES  | MUL | NULL    |       |
| cycle      | varchar(45)  | NO   | MUL | NULL    |       |
+------------+--------------+------+-----+---------+-------+

我想从字段 "title" 和 "cycle"

中删除索引

我试过了:

DROP index  cycle  ON Regions

我也试过了:

ALTER TABLE Regions drop index cycle

但是没用

有人可以指点一下吗?

谢谢!

索引的名称是什么?如果它们与字段名称相同,这应该有效...

DROP INDEX `title` ON Regions;

或者这个...

ALTER TABLE `Regions` DROP INDEX `title`;

你的语法实际上是正确的。 DROP INDEX 将从您的列中删除索引。

但是,您必须使用索引的名称,而不是列的名称。您使用的名称 cycle 实际上是列名。要找出索引的名称,请使用 SHOW INDEX 命令:

SHOW INDEX FROM Regions

找到索引名称后,您可以删除它:

DROP INDEX name_of_your_index FROM Regions