How do I enable the MySQL function that logs each SQL query statement received from clients and the time that query statement has submitted?
Can I do that in phpmyadmin or NaviCat?
How do I analyse the log?
How do I enable the MySQL function that logs each SQL query statement received
Share
First, Remember that this logfile can grow very large on a busy server.
For mysql < 5.1.29:
To enable the query log, put this in
/etc/my.cnfin the[mysqld]sectionAlso, to enable it from MySQL console
See http://dev.mysql.com/doc/refman/5.1/en/query-log.html
For mysql 5.1.29+
With mysql 5.1.29+ , the
logoption is deprecated. To specify the logfile and enable logging, use this in my.cnf in the[mysqld]section:Alternately, to turn on logging from MySQL console (must also specify log file location somehow, or find the default location):
Also note that there are additional options to log only slow queries, or those which do not use indexes.