Linux環境下查看MySQL儲存引擎:
Server version: 5.0.45 Source distribution
mysql> show engines;
+------------+---------+----------------------------------------------------------------+
| Engine | Support | Comment |
+------------+---------+----------------------------------------------------------------+
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys |
| BerkeleyDB | YES | Supports transactions and page-level locking |
| BLACKHOLE | NO | /dev/null storage engine (anything you write to it disappears) |
| EXAMPLE | NO | Example storage engine |
| ARCHIVE | NO | Archive storage engine |
| CSV | NO | CSV storage engine |
| ndbcluster | NO | Clustered, fault-tolerant, memory-based tables |
| FEDERATED | NO | Federated MySQL storage engine |
| MRG_MYISAM | YES | Collection of identical MyISAM tables |
| ISAM | NO | Obsolete storage engine |
+------------+---------+----------------------------------------------------------------+
12 rows in set (0.00 sec)這個表格顯示了可用的資料庫引擎的全部名單以及在當前的資料庫伺服器中是否支援這些引擎。
更靈活的方式是在隨MySQL伺服器發布同時提供的MySQL用戶端時指定使用的儲存引擎。最直接的方式是在建立表時指定儲存引擎的類型,向下面這樣:
CREATE TABLE mytable (id int, title char(20)) ENGINE = INNODB
你還可以改變現有的表使用的儲存引擎,用以下語句:
ALTER TABLE mytable ENGINE = MyISAM