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
廣告