node2:/root#mysql -uroot -p1234567 --socket='/data01/mysql/mysql.sock' -e"show processlist"
Warning: Using a password on the command line interface can be insecure.
+----+------+---------------------+--------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+---------------------+--------+---------+------+-------+------------------+
| 30 | root | 192.168.137.1:54289 | django | Sleep | 334 | | NULL |
| 31 | root | 192.168.137.1:54290 | django | Sleep | 334 | | NULL |
| 33 | root | node2:42138 | tlcb | Sleep | 818 | | NULL |
| 78 | root | localhost | DEVOPS | Sleep | 16 | | NULL |
| 88 | root | localhost | NULL | Query | 0 | init | show processlist |
+----+------+---------------------+--------+---------+------+-------+------------------+
node2:/root#
21.16 The INFORMATION_SCHEMA PROCESSLIST Table
PROCESSLIST表提供了信息关于运行的线程
The PROCESSLIST table has these columns:
ID
连接标识符,这与show processlist 语句的ID列是一样的
User
执行语句的MYSQL用户,system user的值指向一个非客户端线程 通过server 派生来处理内部任务
HOST
执行SQL语句的客户端的名字(系统用户除外,没有主机名)
DB
如果选择了默认数据库,则为数据库,否则为空
COMMAND
线程正在执行的命令
TIME
线程处于当前状态的事件,对于slave sql线程, 值是最后复制事务的事件和salve机器当前的时间
的秒数