SHOW CONFIG

SHOW CONFIG 语句用于展示 TiDB 各个组件当前正在应用的配置,请注意,配置与系统变量作用于不同维度,请不要混淆,如果希望获取系统变量信息,请使用 SHOW VARIABLES 语法。

语法图

ShowConfigStmt

SHOW CONFIG - 图1

ShowLikeOrWhere

SHOW CONFIG - 图2

  1. ShowConfigStmt ::=
  2. "SHOW" "CONFIG" ShowLikeOrWhere?
  3. ShowLikeOrWhere ::=
  4. "LIKE" SimpleExpr
  5. | "WHERE" Expression

示例

显示所有配置:

  1. SHOW CONFIG;
  1. +------+----------------+-------------------------------------------------+---------------------------------------------------------------------+
  2. | Type | Instance | Name | Value |
  3. +------+----------------+-------------------------------------------------+---------------------------------------------------------------------+
  4. | tidb | 127.0.0.1:4000 | advertise-address | 127.0.0.1 |
  5. | tidb | 127.0.0.1:4000 | binlog.binlog-socket | |
  6. | tidb | 127.0.0.1:4000 | binlog.enable | false |
  7. ...
  8. 120 rows in set (0.01 sec)

显示 typetidb 的配置:

  1. SHOW CONFIG WHERE type = 'tidb' AND name = 'advertise-address';
  1. +------+----------------+-------------------+-----------+
  2. | Type | Instance | Name | Value |
  3. +------+----------------+-------------------+-----------+
  4. | tidb | 127.0.0.1:4000 | advertise-address | 127.0.0.1 |
  5. +------+----------------+-------------------+-----------+
  6. 1 row in set (0.05 sec)

也可以用 LIKE 子句来显示 typetidb 的配置:

  1. SHOW CONFIG LIKE 'tidb';
  1. +------+----------------+-------------------------------------------------+---------------------------------------------------------------------+
  2. | Type | Instance | Name | Value |
  3. +------+----------------+-------------------------------------------------+---------------------------------------------------------------------+
  4. | tidb | 127.0.0.1:4000 | advertise-address | 127.0.0.1 |
  5. | tidb | 127.0.0.1:4000 | binlog.binlog-socket | |
  6. | tidb | 127.0.0.1:4000 | binlog.enable | false |
  7. ...
  8. 40 rows in set (0.01 sec)

MySQL 兼容性

该语句是 TiDB 对 MySQL 语法的扩展。

另请参阅