If the login user has the super permission, you can see the status of all connections to MySQL.
mysql> show processlist ;+----------+---------+----------------------+------+-------------+-------+----------------------------------------------------------------+------------------+| Id | User | Host | db | Command | Time | State | Info |+----------+---------+----------------------+------+-------------+-------+----------------------------------------------------------------+------------------+| 41419293 | jw_sync | 172.24.224.28:45800 | NULL | Sleep | 65190 | | NULL | | 41419294 | jw_sync | 172.24.224.28:45801 | NULL | Binlog Dump | 65197 | Has sent all binlog to slave; waiting for binlog to be updated | NULL | | 41486860 | jw_sync | 172.23.100.210:36396 | NULL | Query | 0 | NULL | show processlist | +----------+---------+----------------------+------+-------------+-------+----------------------------------------------------------------+------------------+
The ID indicates a serial number. The user column indicates the connected user name, the host indicates the connected Host IP address and port, and the DB indicates the current dB. Command
Sleep: waiting for the client to send the command
BINLOG dump: BINLOG dump thread
Query: query command
mysql> show databases;+--------------------+| Database |+--------------------+| information_schema | | dc_params_06 | | dc_params_07 | | mysql | | test | +--------------------+
After changing dabatase, the DB column is changed.
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> show processlist ;+----------+---------+----------------------+------+-------------+-------+----------------------------------------------------------------+------------------+| Id | User | Host | db | Command | Time | State | Info |+----------+---------+----------------------+------+-------------+-------+----------------------------------------------------------------+------------------+| 41419293 | jw_sync | 172.24.224.28:45800 | NULL | Sleep | 65560 | | NULL | | 41419294 | jw_sync | 172.24.224.28:45801 | NULL | Binlog Dump | 65567 | Has sent all binlog to slave; waiting for binlog to be updated | NULL | | 41486860 | jw_sync | 172.23.100.210:36396 | test | Query | 0 | NULL | show processlist | +----------+---------+----------------------+------+-------------+-------+----------------------------------------------------------------+------------------+