How to see full query from SHOW PROCESSLIST

后端 未结 5 1140
無奈伤痛
無奈伤痛 2020-12-07 07:16

When I issue SHOW PROCESSLIST query, only first 100 characters of the running SQL query are returned in the info column.

Is it possible to change Mysql config or iss

5条回答
  •  广开言路
    2020-12-07 07:58

    Show Processlist fetches the information from another table. Here is how you can pull the data and look at 'INFO' column which contains the whole query :

    select * from INFORMATION_SCHEMA.PROCESSLIST where db = 'somedb';
    

    You can add any condition or ignore based on your requirement.

    The output of the query is resulted as :

    +-------+------+-----------------+--------+---------+------+-----------+----------------------------------------------------------+
    | ID    | USER | HOST            | DB     | COMMAND | TIME | STATE     | INFO                                                     |
    +-------+------+-----------------+--------+---------+------+-----------+----------------------------------------------------------+
    |     5 | ssss | localhost:41060 | somedb | Sleep   |    3 |           | NULL                                                     |
    | 58169 | root | localhost       | somedb | Query   |    0 | executing | select * from sometable where tblColumnName = 'someName' |
    

提交回复
热议问题