• MySQL show processlist如何进行过滤


    show processlist展示的内容是从information_schema.processlist数据表查询得到

    所以可以使用SQL语句的条件查询进行过滤

    mysql> desc information_schema.processlist;
    +---------+-----------------+------+-----+---------+-------+
    | Field   | Type            | Null | Key | Default | Extra |
    +---------+-----------------+------+-----+---------+-------+
    | ID      | bigint unsigned | NO   |     |         |       |
    | USER    | varchar(32)     | NO   |     |         |       |
    | HOST    | varchar(261)    | NO   |     |         |       |
    | DB      | varchar(64)     | YES  |     |         |       |
    | COMMAND | varchar(16)     | NO   |     |         |       |
    | TIME    | int             | NO   |     |         |       |
    | STATE   | varchar(64)     | YES  |     |         |       |
    | INFO    | varchar(65535)  | YES  |     |         |       |
    +---------+-----------------+------+-----+---------+-------+
    8 rows in set (0.01 sec)
    
    mysql> select * from information_schema.processlist;
    +-----+-----------------+-----------------+------------+---------+-------+------------------------+----------------------------------------------+
    | ID  | USER            | HOST            | DB         | COMMAND | TIME  | STATE                  | INFO                                         |
    +-----+-----------------+-----------------+------------+---------+-------+------------------------+----------------------------------------------+
    | 120 | root            | localhost:43378 | trading_db | Sleep   |    45 |                        | NULL                                         |
    | 121 | root            | localhost       | NULL       | Query   |     0 | executing              | select * from information_schema.processlist |
    |   5 | event_scheduler | localhost       | NULL       | Daemon  | 77571 | Waiting on empty queue | NULL                                         |
    +-----+-----------------+-----------------+------------+---------+-------+------------------------+----------------------------------------------+
    3 rows in set (0.00 sec)
    

      

  • 相关阅读:
    kubernetes 中遇见的一些坑(持续更新)
    Docker网络解决方案-Flannel部署记录
    理解Docker :Docker 网络
    全面剖析Redis Cluster原理和应用
    python发送钉钉机器人脚本
    centos 7 部署LDAP服务
    zabbix 同步ldap帐号脚本
    zabbix TCP 连接数监控
    WebDriver基本操作入门及UI自动化练手页面
    Jmeter使用入门
  • 原文地址:https://www.cnblogs.com/john-xiong/p/13527548.html
Copyright © 2020-2023  润新知