Database plays a very important part in any CMS or website as it stores the complete data but this database sometime becomes headache. Your website start running slow and when you contact your hosting company you get reply “You need to optimize your database” OR sometime for hosting company also its very hard to explain high resource usage by MySQL Database as usually System Admins are depended on “top” command which doesn’t provide accurate information.

MyTop is a console based utility which helps user to monitor the threads and performance of MySQL Database Server. This utility is easy to install and useful for Database Administrators, Server Administrators. In this article I will explain how to install and use MyTop.

1) Download: Download latest version of myTop from http://jeremy.zawodny.com/mysql/mytop/ using command wget

4) Configure MyTop: To get results from MyTop you have user various command-line arguments like username, password, hostname (you can check all options using command “man mytop”)etc. everytime OR you can setup a config file and mention everything in that. Create and open file “~/.mytop” (copy and paste name as written) using your favraite editor and then copy paste following conent

user=[database user]pass=[password of the user]host=[IP or hostname of the host]db=[database name]delay=5port=[Port Number]socket=batchmode=0header=1color=1idle=1

Make sure it should look like:

5) Checking Mysql Usage: You can check the MySQL usage using command “mytop“

root@server [~]# mytop

Which will show output like below

*** Problem: When you execute mytop you will get error “Error in option spec: “long|!”“

Related

Milind Koyande loves to work on new technologies specially virtualization and troubleshoot server problems. I’m an avid photographer and love to spend my free time close to nature, trying to capture its glory on my camera.