Saturday, April 21, 2012

Mysql : HOWTO Enable query logging

Enable query logging in your development DB!

• Are all those queries really necessary? Cache candidates?
• (you do have a devel db, right?)
• Just add “log=/var/lib/mysq/sql.log” to .cnf
• Slow query logging:
log-slow-queries
log-queries-not-using-indexes
long_query_time=1
• mysqldumpslow parses the slow log
• 5.1+ does not require a server restart and, can log directly into a CSV table...

No comments:

Post a Comment