How to run Processlist periodically on the command line?

Asked

Viewed 399 times

1

Is there any way to see the command SHOW PROCESSLIST from X to X seconds via the command line?

I am using Ubuntu 16 Operating System.

  • If you use the watch SHOW PROCESSLIST can view x in x seconds (even can specify the time), if I understood your question correctly :p

  • @Tuxpilgrim did not work.

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 be 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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.