简体   繁体   中英

How can I drop multiple primary keys in phpmyadmin tables?

I am working with phpmyadmin.I created a table with one primary key and 5 fields. But now all the integer fields have turned into a primary key. I tried using drop command but it doesn't help. How can I remove all primary keys from the table?

Just open up the Structure tab on your phpmyadmin table. After the structure description, there should be a Indexes section where you'll see all indexes, including your primary keys. There you'll be able to either modify or remove any primary key you may have defined.

---- EDIT ----

在此输入图像描述

Try this

ALTER TABLE tablename MODIFY fieldname INT NOT NULL;
ALTER TABLE tablename DROP PRIMARY KEY;

Here, i will tell you the Steps to do:

Step 1: Go to the Relation View.

Step 2: Indexes.

Step 3: You will find Keyname as PRIMARY.

Step 4: Drop the PRIMARY

Step 5: Ok.

Thanks.

Here all the Steps images, you can follow it for your easy.

在此输入图像描述

在此输入图像描述

在此输入图像描述

在此输入图像描述

您可能已将列索引为FOREIGN KEY,在此cas中您应删除此索引,然后您将能够修改或删除您的PRIMARY KEY。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM