Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Need some help. I've looked around topics here on stack and on mysql's website and none of the configurations ever work for me. I need to enable the MySQL slow query log as well as teh general query log. I want to do it in my config file rather than as a SET statement because I assume that would reset whenever mysql was rebooted?

What am I missing?! Every site says something completely different... I'm using MySQL 5.5.15. This is my current config:

[mysqld]
local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
skip-external-locking

query_cache_limit=8M
query_cache_size=64M
query_cache_type=1

long_query_time=2
slow_query_log_file=/var/log/mysqld.slow.log

max_connections=100
max_user_connections=10
interactive_timeout=20
wait_timeout=20
connect_timeout=6

thread_cache_size=128
key_buffer=16M
key_buffer_size=256M

join_buffer=1M
max_allowed_packet=16M
table_cache=1024
read_buffer_size=2M
sort_buffer_size=2M
max_connect_errors=10

# Try number of CPU's*2 for thread_concurrency
thread_concurrency=4
myisam_sort_buffer_size=64M

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
share|improve this question

migrated from stackoverflow.com Sep 9 '11 at 19:17

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 1

up vote 2 down vote accepted

Add slow_query_log=1 to your config file.

Reference

share|improve this answer
    
GENIUS! For some reason when I tried using that before mysql failed to start up again >_<... Do you know how to turn the general query log on as well and specify the file? –  Benno Sep 9 '11 at 0:09
    
general_log=1 and general_log_file=/var/log/mysqld.general.log –  Christopher Armstrong Sep 9 '11 at 0:18
    
    
Thanks for that! :) –  Benno Sep 9 '11 at 0:57
    
why 1? is that milliseconds? why not 5 or 10? –  Rick Sep 23 '13 at 18:07
show 1 more comment

Your Answer

 
discard

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.