MySQL删除UNIQUE KEY约束失败求助:执行语句无效怎么办?
Let's walk through why your ALTER TABLE statement isn't working and get it fixed step by step:
1. Fix the table name typo first
The most obvious issue I spot: your drop statement uses table as the table name, but your actual table is table1. Correct that first with this adjusted query:
ALTER TABLE table1 DROP INDEX UNIQ_60349993F97DBD80;
2. Try the dedicated UNIQUE KEY drop syntax
Since this is a UNIQUE KEY (not just a regular index), using the specialized DROP UNIQUE clause can be more reliable for InnoDB tables:
ALTER TABLE table1 DROP UNIQUE UNIQ_60349993F97DBD80;
3. Verify the index exists with the exact name
If the above still fails, double-check that the index name is correct by listing all indexes on the table:
SHOW INDEX FROM table1;
Look for the Key_name column in the results—confirm it matches UNIQ_60349993F97DBD80 exactly (case shouldn't matter here with latin1_general_ci, but it's worth ruling out typos).
4. Check for dependent objects
InnoDB might block the drop if there's a foreign key constraint or other database object relying on this unique index. If you get an error referencing dependencies, you'll need to drop or modify those dependent objects first before removing the index.
内容的提问来源于stack exchange,提问作者fatma_wings

