How to remove unique key from mysql table

后端 未结 7 1932
旧巷少年郎
旧巷少年郎 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:43

    For those who don't know how to get index_name which mentioned in Devart's answer, or key_name which mentioned in Uday Sawant's answer, you can get it like this:

    SHOW INDEX FROM table_name;
    

    This will show all indexes for the given table, then you can pick name of the index or unique key that you want to remove.

提交回复
热议问题