How to remove the UNIQUE KEY attribute from a column in Mysql?

Asked

Viewed 4,360 times

4

I created a table in Mysql that uses a column called loja_num with the attribute key dish

UNIQUE KEY loja_num (loja_num,

But now, I would like to remove this attribute from this column. I have already done some searches without success. Does anyone know tell me which command I use in Mysql?

I use XAMPP on Windows and the database is Mysql.

Thank you.

  • Guys, forget it, forget it!! It was solved as follows: 1) I searched for the INDEXES that existed in the database: 'SHOW INDEXES FROM lojas_info;' Then I deleted the INDEX that contained the UNIQUE KEY: 'ALTER TABLE lojas_info DROP INDEX loja_num;'

  • 1

    If you have found the solution, post an answer to your own question.

  • @Igorsantana would be nice if you post the solution in the answer, so it would help future visitors with the same doubt.

  • But I posted up there... see: 1) I searched for the INDEXES that existed in the database: 'SHOW INDEXES FROM lojas_info;' Then I deleted the INDEX that contained the UNIQUE KEY: 'ALTER TABLE lojas_info DROP INDEX loja_num;'

1 answer

5


The very one @Igorsantana commented on the resolution as follows::

  1. He researched which Index existed in the bank.

    SHOW INDEXES FROM lojas_info;
    
  2. Deleted the index that contained the UNIQUE KEY:

    ALTER TABLE lojas_info DROP INDEX loja_num;
    
  • Oops... that’s right! Thanks... I’m still getting used to this forum! Thanks! D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.