MySQL Drop Unique Constraint

Examples

In MySQL 5.0 it is possible to drop unqiue constraints but, the syntax is not incredibly intuitive.

alter table TABLE_NAME drop index UNIQUE_CONSTRAINT_NAME;

Code Ghar provides a more thorough description.

1 Comment

1 Comment

  1. linuxrawkstar  •  Jul 8, 2009 @07:45

    It’s also worth noting that
    1) you must not use quotes of any kind around UNIQUE_CONSTRAINT_NAME
    2) you can find the name of the constraint by entering at the mysql shell:
    SHOW CREATE TABLE TABLE_NAME
    …where TABLE_NAME is the name of the table containing the constraint.

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>