简体   繁体   English

如何在phpmyadmin表中删除多个主键?

[英]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. 我正在使用phpmyadmin.I创建了一个包含一个主键和5个字段的表。 But now all the integer fields have turned into a primary key. 但是现在所有的整数字段都变成了主键。 I tried using drop command but it doesn't help. 我尝试使用drop命令,但它没有帮助。 How can I remove all primary keys from the table? 如何从表中删除所有主键?

Just open up the Structure tab on your phpmyadmin table. 只需打开phpmyadmin表上的Structure选项卡即可。 After the structure description, there should be a Indexes section where you'll see all indexes, including your primary keys. 在结构描述之后,应该有一个Indexes部分,您可以在其中看到所有索引,包括主键。 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. 第1步:转到关系视图。

Step 2: Indexes. 第2步:索引。

Step 3: You will find Keyname as PRIMARY. 第3步:你会发现Keyname是主要的。

Step 4: Drop the PRIMARY 第4步:放下PRIMARY

Step 5: Ok. 第5步:好的。

Thanks. 谢谢。

Here all the Steps images, you can follow it for your easy. 在这里所有的步骤图像,您可以轻松跟随它。

在此输入图像描述

在此输入图像描述

在此输入图像描述

在此输入图像描述

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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