How do I monitor what my MySQL server is doing?

by monk · 0 comments

To solve MySQL problems or to optimize MySQL server you need to use special tool called mytop. It is a UNIX top command clone for MySQL server. It updates every few seconds, so you can get a reasonable look at your SQL performance. It is capable of displaying a huge amount of information.

Please note that it needs Perl and other CPAN package to run. If you are using Debian then just install it using apt-get command or Download it from official web site:

# apt-get install mytop

How do I use mytop command?
mytop command needs username and password to access MySQL server. For example if your username is admin and password is 123456 then you can start mytop as follows:

$ mytop -u admin -p 123456

You can also specify database (phpbb) to monitor:

$ mytop -u admin -p 123456 -d phpbb

You can store this information in ~/.mytop file:

vi ~/.mytop

Add config text as follows:

user=admin
pass=123456
host=mysql0.hosting.some.com
db=imail
delay=10
port=3306
socket=
batchmode=0
header=1
color=1
idle=1

mytop is capable of displaying a large amount of information and it supports lots of keyboard shortcut too, so be sure to read the man page and documentation of mtop.

Featured Articles:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post: