how to customize `show processlist` in mysql?

前端 未结 6 1026
孤城傲影
孤城傲影 2021-01-29 18:11

I want to order by Time,but seems no way to do that ?

mysql> show processlist;
+--------+-------------+--------------------+------+---------+--------+--------         


        
6条回答
  •  没有蜡笔的小新
    2021-01-29 18:45

    Newer versions of SQL support the process list in information_schema:

    SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
    

    You can ORDER BY in any way you like.

    The INFORMATION_SCHEMA.PROCESSLIST table was added in MySQL 5.1.7. You can find out which version you're using with:

    SELECT VERSION()
    

提交回复
热议问题