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.
[code language=”text”]
log = /path/to/your/logfile.log
[/code]
For MySQL >=5.1.12, it can be done without restarting MySQL.
To log to the table mysql.general_log
[code language=”sql”]
SET GLOBAL log_output = ‘TABLE’;
SET GLOBAL general_log = ‘ON’;
[/code]
To log to file.
[code language=”sql”]
SET GLOBAL log_output = "FILE";
SET GLOBAL general_log_file = /path/to/your/logfile.log
SET GLOBAL general_log = ‘ON’;
[/code]
Note:
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
Related Posts