Skip to content

5.1 How to Monitor MySQL connections and queries

Juan Fernando Villa Hernández edited this page Mar 13, 2015 · 1 revision
  1. Install my top

apt-get install mytop

  1. First time mytop --prompt

this will give you a password prompt, simply hit enter and you will be through

or

mytop -u root -p

in here you will have to use your mysql password, because you are specifying a user "root" here 3) Make a cfg file nano ~/.mytop

populate with:


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.