SHOW [GLOBAL|SESSION] STATUS

SHOW [GLOBAL|SESSION] STATUS 语句用于提供 MySQL 兼容性。对于大部分监控指标,TiDB 使用 Prometheus 和 Grafana 来集中收集,而不是使用 SHOW STATUS。

该语句输出中各变量的详细介绍,请参考服务器状态变量。

语法图

ShowStatusStmt

SHOW STATUS - 图1

Scope

SHOW STATUS - 图2

ShowLikeOrWhere

SHOW STATUS - 图3

1. ShowStatusStmt ::=
2. 'SHOW' Scope? 'STATUS' ShowLikeOrWhere?
3. Scope ::=
4. ( 'GLOBAL' | 'SESSION' )
5. ShowLikeOrWhere ::=
6. "LIKE" SimpleExpr
7. |   "WHERE" Expression

示例

1. SHOW SESSION STATUS;
1. +-------------------------------+--------------------------------------+
2. | Variable_name                 | Value                                |
3. +-------------------------------+--------------------------------------+
4. | Compression                   | OFF                                  |
5. | Compression_algorithm         |                                      |
6. | Compression_level             | 0                                    |
7. | Ssl_cipher                    |                                      |
8. | Ssl_cipher_list               |                                      |
9. | Ssl_server_not_after          |                                      |
10. | Ssl_server_not_before         |                                      |
11. | Ssl_verify_mode               | 0                                    |
12. | Ssl_version                   |                                      |
13. | Uptime                        | 1409                                 |
14. | ddl_schema_version            | 116                                  |
15. | last_plan_binding_update_time | 0000-00-00 00:00:00                  |
16. | server_id                     | 61160e73-ab80-40ff-8f33-27d55d475fd1 |
17. +-------------------------------+--------------------------------------+
18. 13 rows in set (0.00 sec)
1. SHOW GLOBAL STATUS;
1. +-----------------------+--------------------------------------+
2. | Variable_name         | Value                                |
3. +-----------------------+--------------------------------------+
4. | Ssl_cipher            |                                      |
5. | Ssl_cipher_list       |                                      |
6. | Ssl_server_not_after  |                                      |
7. | Ssl_server_not_before |                                      |
8. | Ssl_verify_mode       | 0                                    |
9. | Ssl_version           |                                      |
10. | Uptime                | 1413                                 |
11. | ddl_schema_version    | 116                                  |
12. | server_id             | 61160e73-ab80-40ff-8f33-27d55d475fd1 |
13. +-----------------------+--------------------------------------+
14. 9 rows in set (0.00 sec)

MySQL 兼容性

SHOW [GLOBAL|SESSION] STATUS 语句与 MySQL 兼容。

另请参阅