MySQL - SHOW ENGINES 语句



MySQL SHOW ENGINES 语句

SHOW ENGINES 语句返回 MySQL 存储引擎的当前状态信息。它显示以下详细信息:

  • 引擎 - 引擎名称

  • 支持 - 支持类型,可以是 YES、DEFAULT、NO 和 DISABLED。

  • 注释 - 引擎的描述

  • 事务 - 指定引擎是否支持事务的布尔值。

  • XA - 指定引擎是否支持 XA 事务的布尔值。

  • 保存点 - 指定引擎是否支持保存点的布尔值。

语法

以下是 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;

输出

上述查询产生以下输出:

引擎 支持 注释 事务 XA 保存点
MEMORY YES 基于哈希,存储在内存中,对临时表很有用 NO NO NO
MRG_MYISAM YES 相同 MyISAM 表的集合 NO NO NO
CSV YES CSV 存储引擎 NO NO NO
FEDERATED NO 联合 MySQL 存储引擎 NULL NULL NULL
PERFORMANCE_SCHEMA YES 性能架构 NO NO NO
MyISAM YES MyISAM 存储引擎 NO NO NO
InnoDB DEFAULT 支持事务、行级锁定和外键 YES YES YES
BLACKHOLE YES /dev/null 存储引擎(写入其中的任何内容都会消失) NO NO NO
ARCHIVE YES 存档存储引擎 NO NO NO
广告
© . All rights reserved.