Turn on MySQL logging to log every query request

To turn on the logging to log to a file. Place the following in the my.cnf file or my.ini file if on windows, and restart MySQL.

log = /path/to/your/logfile.log

For MySQL >=5.1.12, it can be done without restarting MySQL.

To log to the table mysql.general_log

SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 'ON';

To log to file.

SET GLOBAL log_output = "FILE"; 
SET GLOBAL general_log_file = /path/to/your/logfile.log
SET GLOBAL general_log = 'ON';

The default log directory for linux is /var/log
The defalut mysql log directory on windows is mysqlHOMEDir/data

Search within Codexpedia

Custom Search

Search the entire web

Custom Search