Monitoring Queries in MySQL in real time

Monitoring Queries in MySQL in real time

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

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *