0

In a table of my database I made the unfortunate mistake of making a pair of fields unique when creating the database

UNIQUE(A,B) 

I now want to remove this constraint. How can I do this in MySQL syntax?

I know for a single index I can do

ALTER TABLE MyTable DROP Index A

But I'm not sure how to do it for pairs.

1 Answers1

0

The key still has a name, and it's probably A unless you also made A a key first or gave it a specific name.

ALTER TABLE MyTable DROP INDEX A

should actually work. Look at the table definition (SHOW CREATE TABLE) to see what the actual name of the key is.

Explosion Pills
  • 188,624
  • 52
  • 326
  • 405