• MySQL 如何使用show processlist进行过滤


    在使用show processlist的时候,直接使用会显示很多的内容,无法很快找到需要的信息。

    如何过滤操作呢?

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

    数据表information_schema.processlist各字段如下:

    mysql> desc information_schema.processlist;
    +---------+---------------------+------+-----+---------+-------+
    | Field   | Type                | Null | Key | Default | Extra |
    +---------+---------------------+------+-----+---------+-------+
    | ID      | bigint(21) unsigned | NO   |     | 0       |       |
    | USER    | varchar(32)         | NO   |     |         |       |
    | HOST    | varchar(64)         | NO   |     |         |       |
    | DB      | varchar(64)         | YES  |     | NULL    |       |
    | COMMAND | varchar(16)         | NO   |     |         |       |
    | TIME    | int(7)              | NO   |     | 0       |       |
    | STATE   | varchar(64)         | YES  |     | NULL    |       |
    | INFO    | longtext            | YES  |     | NULL    |       |
    +---------+---------------------+------+-----+---------+-------+
    8 rows in set (0.04 sec)
    

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

    >select * from information_schema.processlist where Host like '10.26.201.199%';
    +---------+-------------+---------------------+------+---------+------+-------+------+---------+-----------+---------------+
    | ID      | USER        | HOST                | DB   | COMMAND | TIME | STATE | INFO | TIME_MS | ROWS_SENT | ROWS_EXAMINED |
    +---------+-------------+---------------------+------+---------+------+-------+------+---------+-----------+---------------+
    |  315835 | ora_manager | 10.26.201.199:45028 | NULL | Sleep   | 2796 |       | NULL | 2795673 |         1 |             0 |
    | 1354509 | ora_manager | 10.26.201.199:53340 | NULL | Sleep   |  976 |       | NULL |  975677 |         1 |             0 |
    |  240640 | ora_manager | 10.26.201.199:45802 | NULL | Sleep   |    4 |       | NULL |    3684 |         1 |             0 |
    | 1354510 | ora_manager | 10.26.201.199:53342 | NULL | Sleep   |  976 |       | NULL |  975678 |         1 |             0 |
    |  240641 | ora_manager | 10.26.201.199:45810 | NULL | Sleep   |    4 |       | NULL |    3687 |         1 |             0 |
    |  315836 | ora_manager | 10.26.201.199:45032 | NULL | Sleep   | 2796 |       | NULL | 2795672 |         1 |             0 |
    | 1354511 | ora_manager | 10.26.201.199:53344 | NULL | Sleep   |  976 |       | NULL |  975678 |         1 |          1103 |
    |  315837 | ora_manager | 10.26.201.199:45030 | NULL | Sleep   | 2796 |       | NULL | 2795674 |         1 |          1103 |
    |  240642 | ora_manager | 10.26.201.199:45812 | NULL | Sleep   |    4 |       | NULL |    3687 |         1 |          1103 |
    +---------+-------------+---------------------+------+---------+------+-------+------+---------+-----------+---------------+
    9 rows in set (0.00 sec)
    
  • 相关阅读:
    【CV论文阅读】ExtremeC3Net: 使用高级C3模块的极轻量人像分割模型
    【pytorch基础】pytorch的初始化
    【CV基础】如何理解空洞卷积(dilated convolution)?
    关于研发规范化的一些实践和思考
    vuecli入门项目实战
    C/C++用.ico图片替换.exe图标(VS2017)(转)
    C# 多线程修改控件时,提示在创建窗口句柄之前,不能在控件上调用 Invoke 或 BeginInvoke(转)
    C#读取ACCESS提示“未在本地计算机上注册Microsoft.ACE.OLEDB.12.0提供程序
    ubuntu的常用命令
    C# DataTable 按整形字段排序
  • 原文地址:https://www.cnblogs.com/lanyangsh/p/11673871.html
Copyright © 2020-2023  润新知