Ankur Mukherjee Ankur Mukherjee - 1 year ago 106
MySQL Question

Dropping Unique constraint from MySQL table

How can I drop the "Unique Key Constraint" on a column of a MySQL table using phpMyAdmin?

Answer Source

A unique constraint is also an index.

First use SHOW INDEX FROM tbl_name to find out the name of the index. The name of the index is stored in the column called key_name in the results of that query.

Then you can use DROP INDEX:

DROP INDEX index_name ON tbl_name

or the ALTER TABLE syntax:

ALTER TABLE tbl_name DROP INDEX index_name
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download