MySQL has a feature that allows you to log slow running queries to a file. To enable you just need to add some lines to your my.cnf file, and restart.
Insert the following into /etc/my.cnf:
log-slow-queries = /var/log/mysql/mysql-slow.log
long_query_time = 5
Save my.cnf and do the following when you return to a shell:
#touch /var/log/mysql/mysql-slow.log
#chown mysql:mysql /var/log/mysql/mysql-slow.log
#service mysql restart
Hello from Russia!
Can I quote a post in your blog with the link to you?
Yes, certainly