How to remove unique key from mysql table

后端 未结 7 1964
旧巷少年郎
旧巷少年郎 2021-01-30 08:34

I need to remove a unique key from my mysql table. How can remove that using mysql query.

I tried this but it is not working

alter table tbl_quiz_attempt         


        
7条回答
  •  逝去的感伤
    2021-01-30 08:49

    To add a unique key use :

    alter table your_table add UNIQUE(target_column_name);
    

    To remove a unique key use:

    alter table your_table drop INDEX target_column_name;
    

提交回复
热议问题