mysql - ALTER IGNORE ADD INDEX removed in mysql 5.7.4 - What to use instead? I am trying to add an index to a table, but only if one doesn't exist. I don't know what the index name is. In the mysql manual I found the alter ignore command:

ALTER [IGNORE] TABLE tbl_name
[alter_specification [, alter_specification] ...]
[partition_options]

alter_specification:
table_options
...
| ADD {INDEX|KEY} [index_name]
    [index_type] (index_col_name,...) [index_option] ...


So, I tried to do the following:

ALTER IGNORE TABLE payments ADD INDEX (id_project);


However, this fails, with the following error:

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 'IGNORE TABLE payments ADD INDEX (id_project)' 


Turns out, this has been removed as of mysql 5.7.4.

What's a good way to do this in newer versions of mysql?
This may help:


Rename the existing table and create a new table.
Use insert ignore to copy data from old table to new table.