I have installed a standard installation of mysql on Debian Wheezy and I am confused as to where the logs are supposed to be logged. In my /var/log/ directory, there are files mysql.log which are empty. All logging goes to daemon.log and syslog. To add to the confusion, show variables like '%log%'; shows other logs still (My datadir is /srv/mysql) :

| general_log                             | OFF                               |
| general_log_file                        | /srv/mysql/mysql-systems.log      |
| slow_query_log                          | OFF                               |
| slow_query_log_file                     | /srv/mysql/mysql-systems-slow.log |

I like to keep my logs clean and organized. What would be the best way to log mysql. Should I change it on the mysql level, or in rsyslog. BTW, is there any standard for logs similar to FHS ?


The mysql general_log logs all queries made to the mysql server and by default is disabled. The slow log will log any queries that have "especially long duration" (defaults to 2 minutes). Again this defaults to being disabled.

The default location for mysqld_safe to log is set by: /etc/mysql/conf.d/mysqld_safe_syslog.cnf, which defaults to syslog. You can either filter the results out to a separate file with your rsyslog config, or you can edit your /etc/mysql/my.cnf file, and set a log location for errors with:

 log_error = /var/log/mysql.log
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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