mysql> show processlist; +----+------+-----------------+------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------------+------+---------+------+-------+------------------+ | 2 | root | localhost:58548 | NULL | Query | 0 | NULL | show processlist | | 3 | root | localhost:58555 | NULL | Sleep | 542 | | NULL | +----+------+-----------------+------+---------+------+-------+------------------+ 2 rows in set (0.00 sec) mysql> show global status like ‘%connect%‘; +--------------------------+-------+ | Variable_name | Value | +--------------------------+-------+ | Aborted_connects | 6 | | Connections | 10 | | Max_used_connections | 3 | | Ssl_client_connects | 0 | | Ssl_connect_renegotiates | 0 | | Ssl_finished_connects | 0 | | Threads_connected | 2 | +--------------------------+-------+ 7 rows in set (0.00 sec) mysql>
通过命令show processlist查看到的记录数据(上述命令为2条)与show global status like ‘%connect%‘;查看到的Threads_connected=2是一致的.
时间: 2024-11-05 11:55:19