Ever wondered what SQL statements are fired when you click on various options in phpMyAdmin. You can learn a great deal of SQL if you can just observe what is happening behind the scenes!

All you have to do is just check the localhost.log file in your data directory of mysql.
run the following in a terminal so that you are viewing things as it is happening:

tail -f /path/of/localhost.log

e.g.:
tail -f /usr/local/LAMP/db/mysql/data/localhost.log

Open phpMyAdmin and align these two windows so that you can see both at same time. Now go on clicking the various familiar and unfamiliar links in phpMyAdmin and check the SQLs in the terminal. These not so common SQLs happening behind the scenes are the nuts and bolts if you need to extract server level information about MySQL.

In fact, another useful thing you can check is how many individual SQL connections are made if you just load our home page! Just browse few pages and you may come to know what statements could be causing DB load!

Happy SQLing!

Contributor: Vibhor Singh – Lead Software Development, www.quikr.com

Post By Gishore J Kallarackal (2,121 Posts)

Gishore J Kallarackal is the founder of techgurulive. The purpose of this site is to share information about free resources that techies can use for reference. You can follow me on the social web, subscribe to the RSS Feed or sign up for the email newsletter for your daily dose of tech tips & tutorials. You can content me via @twitter or e-mail.

Website: → Techgurulive

Connect