In this tutorial we will show you how to install and configuration of Mtop (MySQL Database Server Monitoring) on your CentOS 6 server. For those of you who didn’t know, Mtop is an open source real time MySQL Server monitoring program that shows queries which are taking longer time to process and kills those longer queries after certain number of specified time. Mtop program enable us to monitor and identify performance and related issues of MySQL Server from the command line interface similar to Linux Top Command.
This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation Mtop on CentOS 6.
Install Mtop (MySQL Database Server Monitoring) on CentOS 6
Step 1. First, you need to enable RPMForge repository under your Linux machine to download and install latest version of MTOP program.
## RHEL/CentOS 6 32-Bit ## wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.i686.rpm ## RHEL/CentOS 6 64-Bit ## wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
Step 2. Install Mtop using yum.
yum install mtop
Step 3. Starting Mtop.
To start Mtop program, you need to connect to your MySQL Server, using following command:
# mysql -u root -p mysql> grant super, reload, process on *.* to mysqltop; Query OK, 0 rows affected (0.00 sec) mysql> grant super, reload, process on *.* to mysqltop@localhost; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> quit; Bye
Step 4. Running Mtop in CentOS 6.
Mtop usage and functions keys:
s – change the number of seconds to delay between updates m – toggle manual refresh mode on/off d – filter display with regular expression (user/host/db/command/state/info) F – fold/unfold column names in select statement display h – display process for only one host u – display process for only one user i – toggle all/non-Sleeping process display o – reverse the sort order q – quit ? – hel
Congratulation’s! You have successfully installed Mtop. Thanks for using this tutorial for installing Mtop (MySQL Database Server Monitoring) on CentOS 6 system. For additional help or useful information, we recommend you to check the official Mtop web site.