Tag Archives: innodb

PHPMyAdmin: Drop a Foreign Key

Drop the foreign key relation before drop the index. Have a look at the output of:

SHOW CREATE TABLE table_name

It will show the internal name of the foreign key constraint which is use during the table set up process. Drop this foreign key with:

ALTER TABLE table_name DROP FOREIGN KEY key_name

before we can drop the index on the foreign key field. InnoDB relies on indexes on all key columns in a foreign key constraint.