How to avoid #1217 foreign key error in phpMyAdmin when changing the engine of table from InnoDB to MyISAM

66 Views Asked by At

i have some database, that contents some tables, all of them are in InnoDB mode. And also i have phpMyAdmin, where i can manage databases/tables.

For example, i have a table called "cache" that is innodb and works fine. I run the following command:

ALTER TABLE cache ENGINE=myisam;

And get the error:

#1217 - Cannot delete or update a parent row: a foreign key constraint fails

I googled and also tried to use:

SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE cache ENGINE=myisam;

But no luck, still the same error. What can i do to change the ingine?

0

There are 0 best solutions below