Wednesday, May 27, 2009

MySQL Log

To have MySQL log queries on the database, you need to locate your mysql server folder,

usually C:/Program Files/MySQL/MySQL Server.../

In this folder, there should be a file named 'my.ini' or 'my.cnf'.

This file contains global options for the MySQL server.  You can modify this file with the 
'log="[Drive]:/[~Path]/[filename].log"' command.  Put this relatively close to the 

'[mysqld]' heading, but below it in the file.

Restart MySQL server.  You should find a [filename].log file where your path was set.

This is the log file for mysql server, it will log all queries on the databse.

If you want to log all errors, put this command close to the previous command,
'log-error="[Drive]:/[~Path]/[filename]error.log"'.  This will log all errors.

This is for my edition of MySQL Server 5.0.

No comments:

Post a Comment