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;
您可能已将列索引为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.