I want to log all queries to the database running on my MacBook Pro (Mac OS X 10.8.1). I created a file /etc/my.cnf with the following content:


I restarted MySQL and tried some queries on the mysql command line, but nothing gets logged. The file is not getting created. I also created the file myself afterwards to test with touch, but the file remains empty.

When I check, MySQL did read my settings:

mysql> show variables like '%general_log%';
| Variable_name    | Value                |
| general_log      | ON                   |
| general_log_file | /Users/wdb/mysql.log |
2 rows in set (0.01 sec)

Is there anything else I need to do? I suppose any query I type on the command line should get logged, right?

I am using MySQL 5.5.24

  • 3
    The file is probably not writable by the MySQL user. Check the permissions, plus the permissions of the directory it resides in.
    – Philᵀᴹ
    Feb 20, 2013 at 10:17

1 Answer 1


The problem is indeed as @Phil hinted at. To fix it, set the permissions for the _mysql user:

> cd ~
> touch mysql.log
> sudo chown _mysql:wheel mysql.log

Restart MySQL after that and the log file will be used.

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