Which gives us the result as:
| Id | User | Host | db | Command | Time | State | Info |
| 242 | root | localhost | test_db | Query | 0 | NULL | show processlist |
The output shows how many connections are active and their properties.
But for this you need to run the query again and again to analyse the connections information. For a better experience we can use mytop which is very easy to install and just like the top in linux, simple steps need to be followed to make it work.
Step 1:Install mytop using the following command.
anuj@intelligrape:~$ sudo apt-get install mytop
After installation we need make a configuration file .mysqlconfig any where
anuj@intelligrape:~$ vim .mysqlconfig
For more option you can refer to documentation of mytop .
Now just need run this command to see the mysqltop working.
anuj@intelligrape:~$ mytop ~/.mysqlconfig
Thats it ! Internally it runs the query “show processlist” and is very elegant for analysing mysql connections.
This helps me! Hope this helps you guys!