mysql top

Mytop is a tool written in Perl for monitoring MySQL databases. Similar to how top monitors system processes, mytop monitors MySQL threads and the database’s overall performance, allowing system administrators or developers to get some insight on how applications are interacting with a database.

Mytop is included in the Fedora repositories, so it is just a yum install away. If you are using Red Hat Enterprise Linux or CentOS, mytop is available via the RPMForge third-party repositories. Other distributions may provide mytop as a package, or you can install it from source by downloading it from the Web site.

Mytop requires credentials to access the database, which can be provided via a prompt, on the command-line, or stored in the configuration file. In the interest of security, the best method is to use the –prompt option to mytop, which asks for the password each time. If you prefer, you can store the password in the configuration file. Avoid using the -p option that allows you to provide the password as one of the command-line arguments; that will display the password in the process list for any user with access to the ps command to view.

The configuration file mytop uses is ~/.mytop

user=root
#pass=sekret
host=localhost
db=test
#port=3306
socket=/var/lib/mysql/mysql.sock
header=1
color=1

Leave a Reply

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