我环顾四周,发现一些 MySQL 引擎是 innodb 和 MyISAM。也许还有一些。我的问题是这些数据库引擎是什么?
不同的MySQL引擎有什么区别?更重要的是,我如何决定使用哪一个?
最佳答案
mysql> SHOW ENGINES;
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
如果我必须使用 MySQL,我个人总是使用 InnoDB。它支持事务和外键,而 MyISAM 不支持。
关于mysql - 什么是 MySQL 数据库引擎?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4233816/