Dropping Primary Keys and Foreign Keys in MySQL
MySQL allows you to remove primary keys and foreign keys using ALTER TABLE. The exact syntax differs depending on the type of key.
A table can only have one PRIMARY KEY.
Dropping it removes the uniqueness and NOT NULL enforcement on the primary key column(s).
If the primary key column also has AUTO_INCREMENT, you must remove that attribute separately.
Dropping a foreign key requires its constraint name.
The foreign key name is NOT the column name — it is an internal constraint identifier.
If the foreign key also created an index automatically, you may need to drop that index too.
Changing the data type of a primary or foreign key column.
Renaming key-related columns.
Removing relationships between tables.
Redesigning schema constraints.