How can I drop multiple primary keys in phpmyadmin tables?

前端 未结 4 1000
粉色の甜心
粉色の甜心 2021-02-18 23:30

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 i

相关标签:
4条回答
  • 2021-02-18 23:51

    You may have indexed a column as a FOREIGN KEY, in this cas you should delete this index and then you will be able to modify or delete your PRIMARY KEY.

    0 讨论(0)
  • 2021-02-18 23:53

    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.

    0 讨论(0)
  • 2021-02-18 23:58

    Try this

    ALTER TABLE tablename MODIFY fieldname INT NOT NULL;
    ALTER TABLE tablename DROP PRIMARY KEY;
    
    0 讨论(0)
  • 2021-02-19 00:03

    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 ----

    enter image description here

    0 讨论(0)
提交回复
热议问题