SHOW CONFIG

The SHOW CONFIG statement is used to show the current configuration of various components of TiDB. Note that the configuration and system variables act on different dimensions and should not be mixed up. If you want to obtain the system variable information, use the SHOW VARIABLES syntax.

SHOW CONFIG - 图1

Note

This feature is only applicable to TiDB Self-Hosted and not available on TiDB Cloud.

Synopsis

ShowConfigStmt

SHOW CONFIG - 图2

ShowLikeOrWhere

SHOW CONFIG - 图3

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

Examples

Show all configurations:

  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)

Show the configuration where the type is tidb:

  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)

You can also use the LIKE clause to show the configuration where the type is tidb:

  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 compatibility

This statement is a TiDB extension to MySQL syntax.

See also