MySQL – InnoDB与MyISAM

我昨天(http://blogs.sitepoint.com/2010/11/19/mysql-mistakes-php-developers/)阅读了以下文章,并写道:

MySQL has a number of database engines but you’re most likely to encounter MyISAM and InnoDB.

MyISAM is used by default. However, unless you’re creating a very simple or experimental database, it’s almost certainly the wrong choice! MyISAM doesn’t support foreign key constraints or transactions which are essential for data integrity. In addition, the whole table is locked whenever a record is inserted or updated: it causes a detrimental effect on performance as usage grows.

The solution is simple: use InnoDB.

我一直使用MyISAM,因为它是默认的。你怎么看?

如果我要升级到InnoDB,在phpMyAdmin中,我可以编辑每个表并将其更改为innoDB,还是有更复杂的进程来执行?

谢谢!

是的,如果你喜欢,你可以插入和排出发动机,如使用过的内衣,没有太多麻烦。只需在phpmyadmin中更改它。

但我不会改变它为了改变它。你需要使用外键吗?更改。您需要行级锁定而不是表锁定吗?更改。

值得注意的是,也有很好的理由使用MyISAM。看看FULLTEXT索引。你不能用InnoDB这样做。

UPDATE

对于MySQL 5.6 FULLTEXT也已经实现了InnoDB表。这是manual

翻译自:https://stackoverflow.com/questions/4251179/mysql-innodb-vs-myisam

转载注明原文:MySQL – InnoDB与MyISAM