SHOW [STORAGE] ENGINES
SHOW ENGINES
會顯示關於伺服器儲存引擎的狀態資訊。這對於檢查是否支援某個儲存引擎,或是查看預設引擎為何特別有用。
關於 MySQL 儲存引擎的資訊,請參閱第 17 章,InnoDB 儲存引擎,以及第 18 章,替代儲存引擎。
mysql> 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: InnoDB
Support: DEFAULT
Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
XA: YES
Savepoints: YES
*************************** 3. row ***************************
Engine: PERFORMANCE_SCHEMA
Support: YES
Comment: Performance Schema
Transactions: NO
XA: NO
Savepoints: NO
*************************** 4. row ***************************
Engine: MyISAM
Support: YES
Comment: MyISAM storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************************** 5. row ***************************
Engine: MRG_MYISAM
Support: YES
Comment: Collection of identical MyISAM tables
Transactions: NO
XA: NO
Savepoints: NO
*************************** 6. row ***************************
Engine: BLACKHOLE
Support: YES
Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
XA: NO
Savepoints: NO
*************************** 7. row ***************************
Engine: CSV
Support: YES
Comment: CSV storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************************** 8. row ***************************
Engine: ARCHIVE
Support: YES
Comment: Archive storage engine
Transactions: NO
XA: NO
Savepoints: NO
SHOW ENGINES
的輸出可能會因使用的 MySQL 版本和其他因素而有所不同。
SHOW ENGINES
的輸出包含以下欄位:
Engine
儲存引擎的名稱。
Support
伺服器對儲存引擎的支援層級,如下表所示。
值 含義 YES
表示該引擎受支援且為啟用狀態 DEFAULT
與 YES
相同,且表示此為預設引擎NO
表示該引擎不受支援 DISABLED
表示該引擎受支援,但已被停用 NO
值表示伺服器在編譯時未包含該引擎的支援,因此無法在執行時啟用。DISABLED
值表示伺服器啟動時使用了停用該引擎的選項,或是因為未提供啟用該引擎所需的所有選項。在後一種情況下,錯誤日誌應包含指出選項被停用原因的說明。請參閱第 7.4.2 節,「錯誤日誌」。如果伺服器在編譯時支援某個儲存引擎,但啟動時使用了
--skip-
選項,也可能看到該引擎的值為engine_name
DISABLED
。對於NDB
儲存引擎,DISABLED
表示伺服器在編譯時支援 NDB Cluster,但在啟動時未使用--ndbcluster
選項。所有 MySQL 伺服器都支援
MyISAM
表格。無法停用MyISAM
。Comment
關於儲存引擎的簡短描述。
Transactions
表示儲存引擎是否支援交易。
XA
表示儲存引擎是否支援 XA 交易。
Savepoints
表示儲存引擎是否支援儲存點。
儲存引擎資訊也可從 INFORMATION_SCHEMA
ENGINES
表格中取得。請參閱第 28.3.13 節,「INFORMATION_SCHEMA ENGINES 表格」。