General query logging can be very handy in MySQL on profuction server for various debugging needs. Unfortunately you can't switch it on and off without restarting server until MySQL 5.0.
What can you do in MySQL 5.0 and below ?
Use Our Patch - With this patch you can get all queries logged as slow queries (with times) and as you can change long-query-time online you can effectively enable and disable debug logging live. Note however this is not 100% equivalent for general query log - for example connects or queries with syntax errors will not be logged.
Enable logging to /dev/null You can enable queries to say "all_queries" log and symlink that to /dev/null. So when you will need to enable queries you can symlink it to something else and run "flush logs" so logs are …
[Read more]