Sometimes it´s useful to take a look at the querylog, when you
see a growing graph in a monitoring tool and think "what´s
happening there?"
But there is no need to keep it always enabled as it produces I/O
load.
To enable the querylog, the mysqld must be restartet, which means
downtime and this is not acceptable. So I found the following
way:
- start the mysqld with querylog enabled
- delete the querylog file and keep the mysqld running
- issue a "flush logs" when you need the querylog. The mysqld re-creates the file and you can look at it.
- remove the querylog file when finished
Ok, not the perfect way, but it seems to work. But don´t forget
the side effects of a "flush logs". This command creates a new
binlog and errorlog too.