MyTOP is an utility for tracking performance and connections to MySQL/MariDB servers. The interface is very similar to top utility. Further examples is performed in CentOS 6 x64 operating system.
First of all we need to plug Epel repository:
1 2 |
wget http://mirror.omnilance.com/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -Uvh epel-release-6-8.noarch.rpm |
Then:
1 |
yum -y install mytop perl-DBD-MySQL |
Launch:
1 |
mytop -u root --prompt |
or
1 |
mytop -u root -p пароль |
We can get help on available commands by typing ?
The utility can be configured for your own needs by using config file, that should be created in your home directory, for example:
1 |
nano ~/.mytop |
and insert:
1 2 3 4 5 6 7 8 9 10 11 |
<em> user=root #The user you would like to define. pass= #You can define passwords for your user. host=localhost #your hostaname db=test #your database name. delay=5 #time gap to refresh the output of monitoring. port=3306 #port you would like mytop to use. socket= #if you specify any socket mytop will ignore the port number and hostname given, you may just delet it if you don't find it usefull. batchmode=0 #it avoids the clearing of screen and gives you a direct series of queries being used by MySQL. header=1 #Sepcify if you want the header to display or not. You can toggle this with the h key while mytop is running. color=1 #Specify if you want to use any colors in the display (will only work if you have color support). idle=1 #if you want to see idle processes in the process list.</em> |
Detailed help is available by a command:
1 |
man mytop |