martedì 24 agosto 2010

Enable log SQL and SLOW SQL on MySQL

Open /etc/my.cnf and under [mysqld] section insert:

 [mysqld]
...
 # * Logging and Replication  
 #  
 # Both location gets rotated by the cronjob.  
 # Be aware that this log type is a performance killer.  
 log = /var/lib/mysql/log/sql.log  
 log_slow_queries = /var/lib/mysql/log/sql.slow.log  
 long_query_time = 2  

And restart mysqld instance.

Nessun commento: