How to see full query from SHOW PROCESSLIST

后端 未结 5 1135
無奈伤痛
無奈伤痛 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 08:06

    If one want to keep getting updated processes (on the example, 2 seconds) on a shell session without having to manually interact with it use:

    watch -n 2 'mysql -h 127.0.0.1 -P 3306 -u some_user -psome_pass some_database -e "show full processlist;"'
    

    The only bad thing about the show [full] processlist is that you can't filter the output result. On the other hand, issuing the SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST open possibilities to remove from the output anything you don't want to see:

    SELECT * from INFORMATION_SCHEMA.PROCESSLIST
    WHERE DB = 'somedatabase'
    AND COMMAND <> 'Sleep'
    AND HOST NOT LIKE '10.164.25.133%' \G
    

提交回复
热议问题