Mytop – what mysql queries a server is currently processing
Mytop is a very useful program to see what queries a server is currently processing as well as which user is executing them. Think of mytop as top for mysql. If you see a lot from a user that means they are probably the hog. Mytop can also be useful for figuring out exactly which queries are causing the problem in the case of a self-designed website.
We are going to install 2 perl modules in addition to mytop to ensure that it will work.
Install TermReadKey:
cd /usr/local/src
wget http://search.cpan.org/CPAN/authors/id/ … .30.tar.gz
tar -zxf TermReadKey-2.30.tar.gz
cd TermRead*
perl Makefile.PL
make test
make
make install
cd ..
Now install DBI:
wget http://search.cpan.org/CPAN/authors/id/ … .48.tar.gz
tar -zxf DBI-1.48.tar.gz
cd DBI*
perl Makefile.PL
make test
make
make install
cd ..
Finally install mytop:
wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.4.tar.gz
tar -zxf mytop-1.4.tar.gz
cd mytop*
perl Makefile.PL
make test
make
make install
Now simply run “mytop” and your done!
Edit this file
Here is a sample config file ~/.mytop which implements the defaults described above.
user=root
pass=
host=localhost
db=test
delay=5
port=3306
socket=
batchmode=0
header=1
color=1
idle=1
Category: Linux Administration


This post excellently highlights what the author is trying to communicate. Nonetheless, the article has been framed excellently well and all credits to the author.