Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I enable log_slow_queries on MySQL 5.1? Im running redhat.

share|improve this question
up vote 3 down vote accepted

As mentioned by RedMumba, this is correct..


you might also want to consider how "slow" the queries are by seconds that you want to log using

long_query_time = 1   # Log anything over 1 second..

share|improve this answer

You'll want to edit /etc/my.cnf and add:


Where the value is equal to the log file to store the slow queries.


share|improve this answer

You may also want to define what a slow query time is, eg: long_query_time = 5

Both this and log_slow_queries should be in the [mysqld] section.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.