How To Use Mytop (MySQL Database Monitoring)

To Use Mytop (MySQL Database Monitoring)

This tutorial covers the ground on how to use Mytop. The Mytop is an open source and free monitoring program for MySQL databases, using Perl language and it provides a command-line shell interface to monitor real time MySQL threads, queries per second, process list and performance of databases and gives an idea for the database administrator to optimize the server to handle heavy load.

To Install Mytop

Run the following command to install Mytop and check for RPMForge or EPEL repository under RHEL/CentOS systems.

[root@linuxhelp ~]# yum install mytop
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * extras: centos.excellmedia.net
 * rpmforge: mirror1.hs-esslingen.de
 * updates: centos.excellmedia.net
lxcenter-updates                                                                                          | 2.5 kB     00:00     
Resolving Dependencies
.
.
.
Running Transaction
  Installing : mytop-1.7-3.b737f60.el6.noarch                                                                                1/1
  Verifying  : mytop-1.7-3.b737f60.el6.noarch                                                                                1/1

Installed:
  mytop.noarch 0:1.7-3.b737f60.el6                                                                                               

Complete!

Now the installation of Mytop is completed.

To Monitor MySQL using Mytop

Run the following command to start the Mytop shell and provide your root MySQL password when required.

[root@linuxhelp ~]# mytop --prompt
Password:

Once you enter your password, Mytop monitoring shell window appears as below.

To monitor specific database

Use -d option if you want to monitor specific database.

[root@linuxhelp~]# mytop --prompt -d roundcube
Password:

To know more about Mytop application

Run the following command to know more about Mytop application.

# man mytop
Tag : Mytop
FAQ
Q
What is the default configuration file for "mytop" package in Linux?
A
Here I have to mention the default configuration file for "mytop" command. File: "~/.mytop"
Q
How do I know the entire functionality of "mytop" command?
A
You can use the option of "--help" with "mytop" (or) "man" page of "mytop" command to know the entire functionality of "mytop" command. For Ex: "mytop --help" (or) "man mytop".
Q
How to monitor a specific database using the "mytop" command in Linux?
A
You can use see the syntax to monitor a specific database using the "mytop" command in Linux. Syntax: "mytop -prompt -d "DBname"
Q
How to install "Mytop" on CentOS?
A
You can follow the steps as below, to install the "Mytop" package on CentOS.
Syntax: "yum install epel-release"
"yum install mytop –y"
Q
How to run the "Mytop" command use any specified user privilege?
A
You can use the following syntax to run the "Mytop" command use any specified user privilege. For Syntax: "mytop -u username –p"