DEV Community

Bhanu Pratap Singh
Bhanu Pratap Singh

Posted on

1

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)

Image of Quadratic

Free AI chart generator

Upload data, describe your vision, and get Python-powered, AI-generated charts instantly.

Try Quadratic free

👋 Kindness is contagious

Value this insightful article and join the thriving DEV Community. Developers of every skill level are encouraged to contribute and expand our collective knowledge.

A simple “thank you” can uplift someone’s spirits. Leave your appreciation in the comments!

On DEV, exchanging expertise lightens our path and reinforces our bonds. Enjoyed the read? A quick note of thanks to the author means a lot.

Okay