Master da Web
Back to Blog

Monitoring Queries in MySQL in real time

LucasAugust 9, 20191 min readUpdated on November 4, 2023

Monitoring queries that are causing system bottlenecks is a common and extremely useful task.

MySQL comes by default with the mysqladmin utility, which allows you to perform administrative tasks such as checking the MySQL server’s configuration, status, creating a database and so on.

How to monitor Queries in real time using mysqladmin ?

mysqladmin -u root -p --verbose processlist --sleep 1

Given the command above, replace“root” with the username of the database to be monitored, or keep“root” to monitor all databases. The“–sleep 1” parameter corresponds to the interval in seconds for refreshing the screen.

The command gives the following result:

Monitoring Queries in MySQL in real time
Monitoring Queries in MySQL in real time

Meaning of the columns:

userdbteaminfo
User that the camando is runningDatabase on which the query is being executed Time in seconds that the query is running Query being used
Tags#linux#mysql
Share

Need Hosting or Servers?

Discover our VPS, dedicated servers and professional hosting solutions

Related Articles

View all articles