DEV Community

Bhanu Pratap Singh
Bhanu Pratap Singh

Posted on

Mysql Remove Unique Key From Mysql Table

While working with database i came to one situation where at first i have unique key for email in users table but later there come a situation we now i have to remove unique key.
So this is how i made it work.

SHOW INDEX FROM users;

Alt Text

Then based on the result returned you have can remove the key.

ALTER TABLE users DROP INDEX users_email_unique;

Before

Alt Text

After

Alt Text

@Other Reference

@Coderuck

Top comments (0)