Skip to content

Latest commit

 

History

History
83 lines (63 loc) · 3.37 KB

sql-statement-show-config.md

File metadata and controls

83 lines (63 loc) · 3.37 KB
title summary aliases
SHOW CONFIG
Overview of the use of SHOW CONFIG in the TiDB database
/docs/dev/sql-statements/sql-statement-show-config/

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.

Note:

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

Synopsis

ShowConfigStmt ::=
    "SHOW" "CONFIG" ShowLikeOrWhere?

ShowLikeOrWhere ::=
    "LIKE" SimpleExpr
|   "WHERE" Expression

Examples

Show all configurations:

SHOW CONFIG;
+------+----------------+-------------------------------------------------+---------------------------------------------------------------------+
| Type | Instance       | Name                                            | Value                                                               |
+------+----------------+-------------------------------------------------+---------------------------------------------------------------------+
| tidb | 127.0.0.1:4000 | advertise-address                               | 127.0.0.1                                                           |
| tidb | 127.0.0.1:4000 | binlog.binlog-socket                            |                                                                     |
| tidb | 127.0.0.1:4000 | binlog.enable                                   | false                                                               |
...
120 rows in set (0.01 sec)

Show the configuration where the type is tidb:

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

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

SHOW CONFIG LIKE 'tidb';
+------+----------------+-------------------------------------------------+---------------------------------------------------------------------+
| Type | Instance       | Name                                            | Value                                                               |
+------+----------------+-------------------------------------------------+---------------------------------------------------------------------+
| tidb | 127.0.0.1:4000 | advertise-address                               | 127.0.0.1                                                           |
| tidb | 127.0.0.1:4000 | binlog.binlog-socket                            |                                                                     |
| tidb | 127.0.0.1:4000 | binlog.enable                                   | false                                                               |
...
40 rows in set (0.01 sec)

MySQL compatibility

This statement is a TiDB extension to MySQL syntax.

See also