How to Enable mysql slow query logs in Debian/Ubuntu

Step 1: Modify /etc/mysql/my.cnf File

To enable mysql slow query logs add the lines in my.cnf file.

#vi /etc/mysql/my.cnf

log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes

Step 2: Restart mysql service

After inserting the above entries restart mysql server.

#service mysqld restart
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

six + 16 =