Jump to content
Pembar

phpmyadmin how to make NOT unique?

Recommended Posts

Hello guys,

 

I am using phpmyadmin and I was trying to figure out how to make a field NOT unique. There is an option to make it unique, on the userinterface. But I can't find the one to remove the unique option.

 

Thank you.

Share this post


Link to post
Share on other sites

Just don't apply the unique constraint to it.

Share this post


Link to post
Share on other sites

There should be a little button you can use to toggle UNIQUE on/off.

Share this post


Link to post
Share on other sites

When you click the little icon that has a red "U" to make it unique, you will see it listed under "Indexes" (below the list of column names).  In that list, you can click the red "X" button to remove it.

  • Like 1

Share this post


Link to post
Share on other sites

trq said: "Just don't apply the unique constraint to it." GREAT, that is REALLY HELPFULL. I already pressed the f--king button, how do I remove it! The subject of this thread is not how to not make mistakes, it is how to undo them!!!!

The phmyadmin user interface I'm using has black U on a blue button (not red as josh suggested). Some of the buttons have a grey background. The grey looks like it is disabled the blue looks like it is on. I don not want unique, so I pressed the button. This marked my field as unique, then the button turned grey, now it is disabled and I cannot un-unique it. Clicking on it now does nothing, does not bring up a list with a red X in it.

Fortunately I found a way to do this without trq's AMAZINGLY UNHELPFUL advice: I discovered by accadent that if I drop the index for that field using an SQL command (not the user interface), it also makes it NOT unique. For example:

ALTER TABLE test DROP INDEX name

Share this post


Link to post
Share on other sites

Be aware that dropping the index could have an impact on the efficiency of your queries. You may need to add the index back again - just don't make it a unique index.

Share this post


Link to post
Share on other sites

Is it still helping if i tell you right know? Coz its look like it has been 3 year since this topic is made. However, i found on web if you decide to drop your unique key, there's 2 method you can follow, first with drop index query on mysql command as usual because unique key is actually an index or (since you asking for this) using PHPMyAdmin and i currently using ver.3.5.7, you can just edit its indexes (its above the information section on the structure tab in the table page you want to edit). Hope its helping and sorry for my bad grammar, greetings from indonesia :)

Share this post


Link to post
Share on other sites

You can do this directly from PhpMyAdmin,

 

Click on STRUCTURE.

 

Then you can see a little blue link : +indexes

 

This open the list of your database indexes, you can then click on Drop on the concerned index.

After that your field is not unique anymore.

Share this post


Link to post
Share on other sites

Thank you StephaneV

 

A clear explanation that worked, despite the vagaries of the phpMyAdmin  user interface.

 

After fiddling with it to get rid of an unintentional "Unique" status, I had about 4 "unique" indexes as a result of clicking the "obvious" button.

 

Thanks again.

Share this post


Link to post
Share on other sites
On 7/5/2009 at 4:51 PM, Pembar said:

Hello guys,

 

I am using phpmyadmin and I was trying to figure out how to make a field NOT unique. There is an option to make it unique, on the userinterface. But I can't find the one to remove the unique option.

 

Thank you.

ALTER TABLE table_name DROP INDEX index_name;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.