Wednesday, February 29, 2012

How to enable MySQL query log

I have found it useful to enable the general query log on my local computer to explore mysql queries.
If you want to follow the advice, "Be aware that this log type is a performance killer".

Steps:

  1. Open the /etc/mysql/my.cnf file.
  2. Activate general_log_file and general_log options in the Logging and Replication section:
general_log_file        = /var/log/mysql/mysql.log
general_log             = 1
The logs are available in the /var/log/mysql/mysql.log file.