Why does MySQL not write the log file?

I wanted to switch on the query log of MySQL. So I added the following to /etc/my.cnf

[mysqld]
log = /var/log/mysql.log

and restarted the server: sudo /etc/init.d/mysql restart, but no log file occured even if I executed some queries.

The Problem was that mysql had no rights for /var/log. So the solution was to create an own directory for mysql

cd /var/log
sudo mkdir mysql
sudo chown mysql:mysql mysql/

and log into it:

log = /var/log/mysql/mysql.log
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: