MySQL查看当前连接
Jihongchang(讨论 | 贡献)2023年1月7日 (六) 08:27的版本 (建立内容为“<syntaxhighlight lang="powershell"> mysql> SHOW FULL PROCESSLIST; +-----+------+-----------------+-----------+---------+------+----------+----------------------…”的新页面)
mysql> SHOW FULL PROCESSLIST;
+-----+------+-----------------+-----------+---------+------+----------+-----------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------------+-----------+---------+------+----------+-----------------------+
| 179 | root | localhost:35486 | jdbc_test | Query | 0 | starting | SHOW FULL PROCESSLIST |
+-----+------+-----------------+-----------+---------+------+----------+-----------------------+
1 row in set (0.00 sec)
mysql> SHOW PROCESSLIST;
+-----+------+-----------------+-----------+---------+------+----------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------------+-----------+---------+------+----------+------------------+
| 179 | root | localhost:35486 | jdbc_test | Query | 0 | starting | SHOW PROCESSLIST |
+-----+------+-----------------+-----------+---------+------+----------+------------------+
1 row in set (0.00 sec)
mysql> SHOW FULL PROCESSLIST;
+-----+------+-----------------+-----------+---------+------+----------+-----------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------------+-----------+---------+------+----------+-----------------------+
| 179 | root | localhost:35486 | jdbc_test | Query | 0 | starting | SHOW FULL PROCESSLIST |
+-----+------+-----------------+-----------+---------+------+----------+-----------------------+
1 row in set (0.00 sec)
mysql> SHOW VARIABLES LIKE '%max_connections%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 151 |
+-----------------+-------+
1 row in set, 1 warning (0.00 sec)
mysql> SHOW STATUS LIKE '%Connection%';
+-----------------------------------+---------------------+
| Variable_name | Value |
+-----------------------------------+---------------------+
| Connection_errors_accept | 0 |
| Connection_errors_internal | 0 |
| Connection_errors_max_connections | 0 |
| Connection_errors_peer_address | 0 |
| Connection_errors_select | 0 |
| Connection_errors_tcpwrap | 0 |
| Connections | 202 |
| Max_used_connections | 10 |
| Max_used_connections_time | 2023-01-07 16:01:36 |
+-----------------------------------+---------------------+
9 rows in set (0.00 sec)