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:
Insert the following into /etc/my.cnf:
Save my.cnf and do the following when you return to a shell: log-slow-queries = /var/log/mysql/mysql-slow.log
long_query_time = 5
#touch /var/log/mysql/mysql-slow.log
#chown mysql:mysql /var/log/mysql/mysql-slow.log
#service mysql restart
0 comments:
Post a Comment