Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I need some help diagnosing a fault

I have a development server and a production server. They are (in the large part) identical in setup. Both are Ubuntu Server 10.04 LTS installs.

I turned on the MySQL slow query logs on both servers, and it works on the development server, but not the production server. On development, the slow query log fills up fairly quicly, but on production, the log file remains empty.

And idea how I can diagnose why it's not working on production? Are there any error logs that might contain the information?

There's nothing obviously relevant in /var/log/mysql/error.log, and /var/log/mysql/mysql-slow.log actually exists - it's just empty.


log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 2

Thanks for any direction.

share|improve this question
What value did you set long_query_time to? And how about the min_examined_row_limit? What query did you use to test? – quanta Oct 24 '11 at 15:20
log_slow_queries = /var/log/mysql/mysql-slow.log, long_query_time = 2, min_examined_row_limit is not set (on either server). I've run a few queries that took longer than 2 seconds. – aidan Oct 24 '11 at 15:30
Which MySQL version are you running? – quanta Oct 24 '11 at 16:06

I'd check the MySQL server versions for the correct parameters to use, as there are differences between them.


Which states that log_slow_queries is depracated as of version 5.1.29, and you need to use slow_query_log = 1 to enable it and slow_query_log_file = /path/to/

Prior to 5.1.29 you used log_slow_queries = /path/to/ to specify where to log the queries to.

Between 5.1.12 and 5.1.29 you could use either variant.

It could be that your production box is 5.1.29 or higher, and your dev box is pre-5.1.29 and can therefore understand the options you are using, and the production box can't...

share|improve this answer
How strange! Server versions are identical: "5.1.41-3ubuntu12.10-log (Ubuntu)", but the old style my.cnf was working on dev but not prod. I've updated both my.cnf's, dev still works - just need to wait until I can restart prod to see if it works... Thanks for the pointer! – aidan Oct 25 '11 at 9:25
The restart of the production server didn't work :( – aidan Dec 13 '11 at 16:35

Can you be more specific on what is 'not working' Is it a system crash? A select not returning the right information? Tables not updating?

In general tools such as the:

explain statement (

show process list (

general query log (

are other avenues of investigation.

share|improve this answer
The slow-query log file just remains empty - like I never enabled it. I've updated my original question. – aidan Oct 24 '11 at 15:32

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.