Friday, January 09, 2009

Turning On Mysql Query Logging

Edit mysql configuration file (my.cnf, like /etc/my.cnf) and the add an entry under mysqld section

[mysqld]
log = /var/log/mysqld-all.log

Follow the steps given below:

1. chown mysql:mysql /var/log/mysqld-all.log

2. chmod o-r /var/log/mysqld-all.log

3. /etc/init.d/mysqld restart

Now when you execute sql you should see the log :)

Comments:
Guess what, I did this on my recent project (though on Windows) :)
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?