Saturday, June 30, 2012

Log slow queries for MySQL

Enabling slow queries log in MySQl (RedHat family):

[mysqld]
#log slow queires that takes more than 1 second
long_query_time=1
log-slow-queries=/var/lib/mysql/logs/mysql_slow_queries.log

Restart MySQL:
service mysqld restart

No comments: