Dropping Unique constraint from MySQL table

后端 未结 10 854
孤城傲影
孤城傲影 2020-11-28 01:32

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

10条回答
  •  死守一世寂寞
    2020-11-28 01:55

    If you want to remove unique constraints from mysql database table, use alter table with drop index.

    Example:

    create table unique_constraints(unid int,activity_name varchar(100),CONSTRAINT activty_uqniue UNIQUE(activity_name),primary key (unid));

    alter table unique_constraints drop index activty_uqniue;
    

    Where activty_uqniue is UNIQUE constraint for activity_name column.

提交回复
热议问题