Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove primary keys in phpmyadmin

image

I have the table shown, which shows AI with the little key icon next to the name (which I assume means it's a primary key) but the right side has primary key grayed out. Additionally for some reason I also have 4 other primary keys defined with no way to remove them (clicking the icon doesn't do anything). Is there any way to remove the keys? Or figure out why they were even set in the first place? I never set any manually myself.

like image 745
Robbie Avatar asked Oct 28 '25 05:10

Robbie


1 Answers

Try this

ALTER TABLE tablename MODIFY fieldname INT NOT NULL;

ALTER TABLE tablename DROP PRIMARY KEY;

Or you can check here

like image 196
ching Avatar answered Oct 31 '25 04:10

ching