mysql> SHOW PROCESSLIST;
+----+--------+----------------------+-------+-------------+--------+-----------------------------------------------------------------------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+--------+----------------------+-------+-------------+--------+-----------------------------------------------------------------------+------------------+
| 3 | copy_u | 192.168.31.128:49106 | NULL | Binlog Dump | 292296 | Master has sent all binlog to slave; waiting for binlog to be updated | NULL |
| 7 | copy_u | 192.168.31.42:60886 | NULL | Binlog Dump | 1688 | Master has sent all binlog to slave; waiting for binlog to be updated | NULL |
| 8 | root | localhost | DATA1 | Query | 0 | init | SHOW PROCESSLIST |
+----+--------+----------------------+-------+-------------+--------+-----------------------------------------------------------------------+------------------+
3 rows in set (0.00 sec)
查看系统上运行的所有线程
mysql> SHOW PROCESSLIST;
+----+--------+---------