I would like to rename an index. I\'ve looked at the alter table documentation, but I can\'t figure out the syntax to simply rename an index. When doing it through the MyS
This question was asked ages ago, and was last updated over half a year ago. Still I feel the need to add this tip:
If the indexed column is used elsewhere as a foreign key, you may encounter an error related to that. Doing this may help:
SET FOREIGN_KEY_CHECKS = 0;
ALTER TABLE tbl DROP INDEX index_name;
ALTER TABLE tbl ADD INDEX new_index_name (indexed_column);
SET FOREIGN_KEY_CHECKS = 1;
Hope someone finds this useful.