how to configuration mysql to log slow query

In this tutorial, i will show you how to configure mysql to log mysql slow query. This is a important feature we always use when tuning application using mysql database.

We do following config in file my.cnf (in linux OS you can find it on /etc/my.cnf, if you using windows can check on this post to find this file):

slow_query_log=1
slow_query_log_file=/var/log/mysql_slow.log

slow_query_log to turn on log slow query
slow_query_log_file to configure file mysql will write log.

Leave a Reply