Poor man’s mytop
I often need to watch a server that’s very minimally configured, e.g. has no Perl DBI libraries installed, and I shouldn’t install anything. The following snippet is a quick way to do that:
watch 'mysqladmin proc | grep -v Sleep | cut -b0-130'
Replace 130 by the width of your terminal, naturally.
(Of course, innotop is much more featureful than mytop, but mytop is the essential functionality we’re going for here!)
Further Reading:






Add ‘-n 10′ to refresh watch every 10 seconds or replace it with the interval of your choice.
Add ‘-d’ to get the differences between runs highlighted.
I usually use the following line:
watch -n 10 -d “mysqladmin proc | … “
The quotes (” or ‘) are needed to enclose the pipe “|”
My $.02
G
Gerry
17 Feb 11 at 9:03 pm
watch –interval=1 –differences ‘mysql -uroot -pPassWd -e “show slave status\G”‘
Shantanu Oak
18 Feb 11 at 2:38 am
My Commandline tells me:
cut: fields and positions are numbered from 1
so i better typed cut with range from 1-130:
watch ‘mysqladmin -u root -p77Gp22TuZ9dC proc | grep -v Sleep | cut -b 1-130′
But, nice command, anyway, thanks for sharing.
Exilist
18 Feb 11 at 5:14 am
I am a honk and going to change my PW now ^^
Exilist
18 Feb 11 at 5:16 am
Heh. Clever.
Jeremy Zawodny
18 Feb 11 at 1:08 pm
I like one liners and your is useful.
But MyTop is so much more. If you are using lots of MyISAM it can be better then innotop. I’ve continued to use it and make some improvements.
http://www.mysqlfanboy.com/mytop/
Mark Grennan
18 Feb 11 at 3:51 pm
What does mytop do that innotop can’t do?
Xaprb
18 Feb 11 at 4:38 pm
Live forever apparently.
Jeremy Zawodny
18 Feb 11 at 10:25 pm
Very true!
Xaprb
23 Feb 11 at 3:02 pm