文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 76%

7.1.10 服务器状态变量7.1.10 Server Status Variables

MySQL 服务器维护许多状态变量,这些变量提供有关其操作的信息。您可以使用 SHOW [GLOBAL | SESSION] STATUS 语句查看这些变量及其值(参见 第 15.7.7.37 节,“SHOW STATUS 语句”)。可选的 GLOBAL 关键字会汇总所有连接的值,而 SESSION 则显示当前连接的值。The MySQL server maintains many status variables that provide information about its operation. You can view these variables and their values by using the SHOW [GLOBAL | SESSION] STATUS statement (see Section 15.7.7.37, “SHOW STATUS Statement”). The optional GLOBAL keyword aggregates the values over all connections, and SESSION shows the values for the current connection.

mysql> SHOW GLOBAL STATUS;
+-----------------------------------+------------+
| Variable_name                     | Value      |
+-----------------------------------+------------+
| Aborted_clients                   | 0          |
| Aborted_connects                  | 0          |
| Bytes_received                    | 155372598  |
| Bytes_sent                        | 1176560426 |
...
| Connections                       | 30023      |
| Created_tmp_disk_tables           | 0          |
| Created_tmp_files                 | 3          |
| Created_tmp_tables                | 2          |
...
| Threads_created                   | 217        |
| Threads_running                   | 88         |
| Uptime                            | 1389872    |
+-----------------------------------+------------+

许多状态变量会被 FLUSH STATUS 语句重置为 0。Many status variables are reset to 0 by the FLUSH STATUS statement.

本节提供每个状态变量的描述。有关状态变量的摘要,请参见 第 7.1.6 节,“服务器状态变量参考”。有关 NDB Cluster 特定状态变量的信息,请参见 第 25.4.3.9.3 节,“NDB Cluster 状态变量”。This section provides a description of each status variable. For a status variable summary, see Section 7.1.6, “Server Status Variable Reference”. For information about status variables specific to NDB Cluster, see Section 25.4.3.9.3, “NDB Cluster Status Variables”.

状态变量具有以下含义。The status variables have the following meanings.