Using MyTop – Ubuntu

Posted by | Posted in Command-Line, Linux, MySQL, Ubuntu | Posted on 20-07-2009

If you ever need to know how well your databases are being queried, mytop is the key. MyTop is a clone of Top for MySQL.

Your Ubuntu server won’t come pre-installed with mytop, so you’ll have to to apt-get to install it.

/usr/bin/sudo /usr/bin/apt-get install mytop

Once mytop is installed and your mysql server is setup, you can view your database stats.

-u : user account
-p : password
-h : server, normally localhost
-d : database you want to view
-P : port, if different from default

mytop -u USER -h SERVER -d DATABASE -p PASSWORD

You should see something like this come up.

MySQL on localhost (5.0.75-0ubuntu10.2)    up 0+00:32:06 [02:09:34] Queries: 5.0
qps:    0 Slow:     0.0         Se/In/Up/De(%):    00/00/00/00   qps now:    0 
Slow qps: 0.0  Threads:    1 (   1/   0) 00/00/00/00  Key Efficiency: 90.0%  
Bps in/out:   0.1/  6.9   Now in/out:   8.3/ 1.3k
 
 Id      User         Host/IP         DB      Time    Cmd Query or State 
 --      ----         -------         --      ----    --- ----------  
38      root       localhost      mysql         0  Query show full processlist

to exit mytop, press the “Q” key.

Join the mailing list

Check your email and confirm the subscription