If you have been around Linux and/or Unix long enough, you have probably heard of “top”. It is a convenient program that can give you information about running processes, memory and cpu usage, load averages and a host of other details about your server. You can do almost the same thing with “mytop”, only specifically focusing on MySQL databases.
Mytop will tell you useful information that will help you optimize your databases and repair any problems you might find. You can install it by doing the following:
For Debian-based Linux distributions, type:
# apt-get install mytop
For Red Hat Enterprise Linux, CentOS or Fedora type:
# yum install mytop
To use mytop, you will need to enter this information:
mytop -u <username> -p <password>
Replace <username> with your database administrator’s username and <password> with the appropriate password. For example:
$ mytop -u admin -p mypassword
With no other options, mytop will display information about all the databases connected to the database server. If you want to focus only on a specific database, add the “-d” option.
$ mytop -u <username> -p <password> -d <database>
For more information about mytop and how to use it, see the program’s online documentation.