How To Install MyTOP – a top clone for MySQL

on June 2 | in Linux | by | with 9 Comments

In this howto i will describe how to install mytop package on CentOS 5.3. MyTOP is top command clone to monitor mysql performance including queries, threads etc. You can get source of it from here to build or you can use rpmforge repositories for pre-build rpms. The machine i used to demonstrte is in production and getting very high mysql access, its running on CentOS 5.3.

1 Setting Up RPMForge Repository

RPMForge repository ( is the biggest rpm respository for RHEL, CentOS for all versions. To enable RPMForge respository run following command. The following command directly install rpm from site.

rpm -Uhv

This rpm will add necessary files in our repository configuration and can be viewed at /etc/yum.repos.d/rpmforge.repo

2 Install MyTOP

Use yum to install mytop on your machine

yum -y install mytop

It will install mytop with all necessary pre-requisite to run mytop.

3 Running MyTOP

To run use


if you have restricted access using password then

mytop -u root -p <password> -h localhost

NOTE: You may get following error in CentOS 5.3
Error in option spec: “long|!”

To fix this do following.

chmod 755 /usr/bin/mytop
vi /usr/bin/mytop

Search for the line

“long|!”              => \$config{long_nums},

Change it to by commenting using #

#”long|!”              => \$config{long_nums},

Now run the command again and it will run fine and you can see mytop giving all the information about you mysql server.


Pin It

related posts

9 Responses to How To Install MyTOP – a top clone for MySQL

  1. Fakeer says:

    whew! thanks

  2. Oliver says:

    Thanks, this was 100% what i needed.

  3. Mohammed says:

    Hi Sohail

    I am having problems with the password

    it is password protected, how do i change the config file

  4. Hi Mohammed,

    What is password protected ?


  5. alireza says:

    thanks , very useful!!!

  6. Tran Nghia says:

    Thank for TUT, but I install by rpm when run mytop error
    Can’t locate Term/ in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/bin/mytop line 165.

    Please help me fix it, thank..

  7. patrick says:

    @ Tran yum install perl-TermReadKey.x86_64

  8. Sathish says:

    Thanks ! Is there any other monitoring tools like this ?

    please let me know

  9. GT says:

    There is iotop, apachetop, varnishtop, nettop for sorting display in same top like manner

Leave a Reply

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

« »