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 can't get the general log to work in this version of MySQL.

I added the following lines to /usr/my.cnf:

general_log = 1
general_log_file = "/var/log/mysql.log"

Then restarted the server:

[root@localhost ~]# service mysql restart
Shutting down MySQL.. SUCCESS!
Starting MySQL. SUCCESS!

The settings seem to be taken into account:

mysql> SHOW VARIABLES LIKE 'general_log%';
| Variable_name    | Value              |
| general_log      | ON                 |
| general_log_file | /var/log/mysql.log |
2 rows in set (0.01 sec)

But the log is never created:

[root@localhost ~]# mysqladmin flush-logs
[root@localhost ~]# ls -al /var/log/mysql.log
ls: cannot access /var/log/mysql.log: No such file or directory

Any idea why?

share|improve this question
up vote 3 down vote accepted

This may seem like a clugy band-aid, but try the following for now...

service mysql stop
touch /var/log/mysql.log
chown mysql:mysql /var/log/mysql.log
service mysql start

This should work. Keep in mind MySQL 5.6.8 is not GA certified.

Please look back at the database home folder (run SHOW VARIABLES LIKE 'datadir';)

Go to the folder and see if a default general log appeared.

You could also try changing it to

general_log = 1
general_log_file = mysql.log

and see if the mysql.log appears in your datadir folder after restarting mysql

share|improve this answer
You were right, this was a permission problem. Thanks! – Benjamin Nov 28 '12 at 22:20

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.