本文共 2559 字,大约阅读时间需要 8 分钟。
官方文档地址:
SHOW [STORAGE] ENGINES
SHOW ENGINES
显示服务器存储引擎的状态信息。这对于检查是否支持某个存储引擎或查看默认引擎是什么特别有用。
查询有关 MySQL 存储引擎的信息,参见 和 。
mysql> SHOW ENGINES\G*************************** 1. row *************************** Engine: ARCHIVE Support: YES Comment: Archive storage engineTransactions: NO XA: NO Savepoints: NO*************************** 2. row *************************** Engine: BLACKHOLE Support: YES Comment: /dev/null storage engine (anything you write to it disappears)Transactions: NO XA: NO Savepoints: NO*************************** 3. row *************************** Engine: MRG_MYISAM Support: YES Comment: Collection of identical MyISAM tablesTransactions: NO XA: NO Savepoints: NO*************************** 4. row *************************** Engine: FEDERATED Support: NO Comment: Federated MySQL storage engineTransactions: NULL XA: NULL Savepoints: NULL*************************** 5. row *************************** Engine: MyISAM Support: YES Comment: MyISAM storage engineTransactions: NO XA: NO Savepoints: NO*************************** 6. row *************************** Engine: PERFORMANCE_SCHEMA Support: YES Comment: Performance SchemaTransactions: NO XA: NO Savepoints: NO*************************** 7. row *************************** Engine: InnoDB Support: DEFAULT Comment: Supports transactions, row-level locking, and foreign keysTransactions: YES XA: YES Savepoints: YES*************************** 8. row *************************** Engine: MEMORY Support: YES Comment: Hash based, stored in memory, useful for temporary tablesTransactions: NO XA: NO Savepoints: NO*************************** 9. row *************************** Engine: CSV Support: YES Comment: CSV storage engineTransactions: NO XA: NO Savepoints: NO
根据使用的 MySQL 版本和其他因素,SHOW ENGINES
的输出可能会有所不同。
SHOW ENGINES
的输出有以下列:
值 | 含义 |
---|---|
YES | 引擎受到支持并且处于有效状态 |
DEFAULT | 引擎受到支持并且处于有效状态,这是默认引擎 |
NO | 不支持该引擎 |
DISABLED | 支持该引擎,但已禁用 |
值为NO
意味着服务器在编译时不支持该引擎,因此不能在运行时启用它。
出现DISABLED
值,要么是因为服务器启动时使用了禁用引擎的选项,要么是因为没有给出启用引擎所需的所有选项。在后一种情况下,错误日志应该包含一个原因,说明为什么禁用该选项。参见 。
如果服务器已编译为支持存储引擎,但使用--skip-engine_name
选项启动,则可能会看到存储引擎被DISABLED
。对于NDB
存储引擎,DISABLED
意味着服务器在编译时支持NDB Cluster
,但没有使用--ndbcluster
选项启动。
所有 MySQL 服务器都支持MyISAM
表。不可能禁用MyISAM
。
还可以从INFORMATION_SCHEMA
ENGINES
表中获取存储引擎信息。参见 。
转载地址:http://kgcg.baihongyu.com/