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.
Each table can only have one primary key. Access can automatically create a primary key field for you when you create a table, or you can specify the fields that you want to use as the primary key.
A table can have only ONE primary key; and in the table, this primary key can consist of single or multiple columns (fields).
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With