Changing the table storage engine in Mysql

Currently, the innodb table storage type, I want to add a full text search to the table, which is only possible on the engine MYISAM. I tried using the => command alter table film engine = myisam; and got an error:

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

Help me please! Thank.

+5
source share
2 answers

You should find tables in the database that reference this table using the FK constraint:

Define the foreign key constraints for the table. Or use

SHOW CREATE TABLE `table_in_db_film`\G;

or

USE db_of_film_table;
SHOW TABLE STATUS LIKE 'film'\G

then follow the necessary instructions

ALTER TABLE film DROP FOREIGN KEY `ibfk_something`;

until you drop all restrictions (naturally replace ibfk_something with your restriction names). After that, you can change the table engine.

+6

MyISAM, .

, MyISAM InnoDB. InnoDB ( , ) MyISAM. () .

: MySQL

+2

All Articles