简体   繁体   English

Mysql,InnoDB到MyISAM以获得全文索引

[英]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 InnoDB中有,因此我想将它们设置为MyISAM

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

Error : Documentation #1214 - The used table type doesn't support FULLTEXT indexes 错误:文档#1214-使用的表类型不支持FULLTEXT索引

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 ? 有人将innoDB转换为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. 我读到MySQL 5.6.4支持全文本...不幸的是,我有5.5.28,并且我在Plesk 11上。我担心如果进行升级,我的服务器会崩溃。

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). 全文索引或外键约束(MyISAM不支持这些约束)只能选择一个(直到MySQL 5.6)。

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. 不幸的是,MySQL 5.5中没有一个既支持外键约束又支持全文索引的表。 As you've already noted MySQL 5.6 does support fulltext indexes for InnoDB . 正如您已经提到的,MySQL 5.6确实支持InnoDB的全文本索引

I recommend updating MySQL if possible. 如果可能,我建议更新MySQL。 MySQL 5.6 is stable. MySQL 5.6是稳定的。

Alternatively use an external full text index like Sphinx or Lucene 或者使用外部全文索引,例如SphinxLucene

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. 虽然没有使用新版本的mysql进行plesk的升级,但是如果没有创建不稳定因素,我将无法升级服务器。

So, I just mysqldump my database and edit tables and keys. 因此,我只是mysqldump我的数据库并编辑表和键。

Tank for the help. 坦克的帮助。 Have a nice day 祝你今天愉快

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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