Tuesday, April 10, 2012

Log every query in mysql

Edit /etc/my.cnf

Add in the following line to the [mysqld] section:

log=/var/log/mysql_query.log

touch /var/log/mysql_query.log

chmod 644 /var/log/mysql_query.log

chown mysql:mysql /var/log/mysql_query.log

sudo /sbin/service mysqld restart

No comments: