Monitoring MySQL

Just a quick tip on monitoring the queries that mysql is handling on a production site. You can use the mysqladmin tool to return a list of the processes currently being handled. Combining this with the UNIX watch command allows a real-time monitoring of what’s going on.

watch -n 1 mysqladmin processlist

The -n 1 specifies that mysqladmin executes every second. Depending on your set-up, you may need to specify a mysql user and password:

watch -n 1 mysqladmin --user=<user> --password=<password> processlist

Something wrong? Suggest an improvement or add a comment (see article history)
Tagged with: mysql, commandlinefu
Filed in: tips

Previous: Following log files with tail -f
Next: Creating large XML files with PHP

Copyright © 2005-2023 David Winterbottom
Content licensed under CC BY-NC-SA 4.0.