#1025 and PHPMYADMIN

Hey Guys,

I’m having troubles deleting a Foreign Key constraint I’ve set up in PHPMYADMIN. For some reason when I click the “drop” link to remove the index I get this irritatingly common error yet I have no idea how to fix it. I have googled around many solutions seem to suggest that doing a “SHOW ENGINE INNODB STATUS” will help me in some way. However to my knowledge that will only reveal the constraints and indexes and I already know which ones are there, PHPMYADMIN tells me which are there. Not only that, when try “SHOW ENGINE INNODB STATUS” I get an error that tells me I need superuser privledges which I don’t think I have access to on my VPS currently.

If you have any clue about what is going please help. I’ve attached some images to show you the error.

I managed to solve it with more Googling. Apparently PHPMYADMIN will permit you to create a bogus FK.

This fixed it:

Use SHOW CREATE TABLE categories to show the name of constraint.

Most probably it will be categories_ibfk_1

Use the name to drop the foreign key first and the column then:

ALTER TABLE categories DROP FOREIGN KEY categories_ibfk_1;
ALTER TABLE categories DROP COLUMN assets_id;