Saturday, August 24, 2013

How to log every query in MySQL on Fedora

In /etc/my.cnf, in the [mysqld] section, add the following 2 lines:

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

Then:

sudo su
touch /var/log/mysql.log
chown mysql:mysql /var/log/mysql.log

Restart mysqld:

sudo /sbin/service mysqld restart

Note that the "log" variable in my.cnf is now deprecated, and doesn't log files in Fedora 14.


No comments: