MySQL Monitoriong of the ProcessList / Queries with a console command


A hilreicher command for problem analysis of MySQL servers is to look at the ProcessList, to see, What Quueries are currently running. If you combine this with the watch command, and these 1 reload times per second can be and reduced to the queries, you did a good review, What is going on on the MySQL server and what queries are problematic could:

watch -n 1 "mysql -u root --password='XXX' -h localhost -s -e 'SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE Command=\"Query\";'"

It is important, the command as root to run, to see all queries.

With the help of the parameter n, you can specify the refresh rate in seconds.

The MySQL root password is to complement.

 

Edition:

5361925476      user     localhost       NULL    Query   0       executing       SELECT * FROM xxx WHERE yyy

5361925477      user     localhost       NULL    Query   0       executing       UPDATE zzz WHERE zzz