MySQL - SHOW ENGINES 语句
MySQL SHOW ENGINES 语句
SHOW ENGINES 语句返回 MySQL 存储引擎的当前状态信息。它显示以下详细信息 -
Engine - 引擎名称
Support - 支持类型,可以是 YES、DEFAULT、NO 和 DISABLED。
Comment - 引擎描述
Transactions - 一个布尔值,指定引擎是否支持事务。
XA - 一个布尔值,指定引擎是否支持 XA 事务。
Savepoints - 一个布尔值,指定引擎是否支持保存点。
语法
以下是 MySQL SHOW ENGINES 语句−
SHOW [STORAGE] ENGINES
示例
您可以使用 SHOW ENGINES 语句检索有关引擎的信息,如下所示 −
SHOW ENGINES\G;
输出
以下是上述查询的输出 -
*************** 1. row ***************
Engine: MEMORY
Support: YES
Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
XA: NO
Savepoints: NO
*************** 2. row ***************
Engine: MRG_MYISAM
Support: YES
Comment: Collection of identical MyISAM tables
Transactions: NO
XA: NO
Savepoints: NO
*************** 3. row ***************
Engine: CSV
Support: YES
Comment: CSV storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************** 4. row ***************
Engine: FEDERATED
Support: NO
Comment: Federated MySQL storage engine
Transactions: NULL
XA: NULL
Savepoints: NULL
*************** 5. row ***************
Engine: PERFORMANCE_SCHEMA
Support: YES
Comment: Performance Schema
Transactions: NO
XA: NO
Savepoints: NO
*************** 6. row ***************
Engine: MyISAM
Support: YES
Comment: MyISAM storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************** 7. row ***************
Engine: InnoDB
Support: DEFAULT
Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
XA: YES
Savepoints: YES
*************** 8. row ***************
Engine: BLACKHOLE
Support: YES
Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
XA: NO
Savepoints: NO
*************** 9. row ***************
Engine: ARCHIVE
Support: YES
Comment: Archive storage engine
Transactions: NO
XA: NO
Savepoints: NO
9 rows in set (0.00 sec)
示例
您也可以在语句中间指定 STORAGE,如下所示:
SHOW STORAGE ENGINES;
输出
上述查询产生以下输出 -
| Engine | Support | Comment | Transactions | XA | Savepoints |
|---|---|---|---|---|---|
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| PERFORMANCE_ SCHEMA | YES | Performance Schema | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |

