简体   繁体   中英

Mysql, InnoDB to MyISAM for fulltext index

Actually, I would like to switch the engine of my tables. There are in InnoDB and I want to set them to MyISAM because of this

ALTER TABLE `xxx_db`.`yyy` ADD FULLTEXT `ft_modele` (
    `anno_modele`
)

Error : Documentation #1214 - The used table type doesn't support FULLTEXT indexes

So... I do this :

ALTER TABLE `annonce` ENGINE = MYISAM 

But I have an error too :

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

I understand the error... but I don't really want to kill all my references index, and re-create them. Too long.

Someone has an idea to convert innoDB to MyISAM ? I read that fulltext is supported for MySQL 5.6.4 ... unfortunately I have 5.5.28 and I'm on Plesk 11. I fear if I do an upgrade, my server crashs.

Someone can help me ?

Fulltext indexes or foreign key constraints (MyISAM does not support those) you can only chose one (until MySQL 5.6 that is).

Changing database engine will result in total table rewrite (creating a new one, moving data, dropping the old one) anyway.

If I were you, I would go for the upgrade.

Unfortunately you can't have a table in MySQL 5.5 that supports both foreign key constraints and fulltext indexes. As you've already noted MySQL 5.6 does support fulltext indexes for InnoDB .

I recommend updating MySQL if possible. MySQL 5.6 is stable.

Alternatively use an external full text index like Sphinx or Lucene

Unformtunately, there is no good option for me. While there is not an upgrade for plesk with the new version of mysql, i can't upgrade the server without create instability.

So, I just mysqldump my database and edit tables and keys.

Tank for the help. Have a nice day

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM