In most versions of Linux edit the file:
/etc/my.cnf
Anywhere under [mysqld] add the line:
log-error=/var/log/mysqld.log
If log file doesn’t yet exists add and set permissions:
touch /var/log/mysqld.log
chown mysql:mysql /var/log/mysqld.log
Restart MySQL in:
cd /etc/rc.d/init.d
./mysqld restart
One Response to “How to Add MySQL Access Logs”
nobbler
you have to add –log-warnings=x where x is larger than 1 to your mysqld execution parameters, see http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_log-warnings