How to run the ProcessList periodically from the command line?

1

Is there any way to see the command SHOW PROCESSLIST of X in X seconds, from the command line?

I'm using the Ubuntu 16 Operating System.

    
asked by anonymous 03.08.2018 / 16:07

1 answer

2

You can use the command mysqladmin -u root -p -i 1 processlist , where:

  • -u user
  • -p will be asked the password
  • -i 1 interval in seconds

The result will look something like this:

+----+------+-----------+----+---------+------+----------+------------------+
| Id | User | Host      | db | Command | Time | State    | Info             |
+----+------+-----------+----+---------+------+----------+------------------+
| 76 | root | localhost |    | Query   | 0    | starting | show processlist |
+----+------+-----------+----+---------+------+----------+------------------+

reference: MySQL: Show processlist every second

    
03.08.2018 / 16:32