how to enable the mysql query log

on a running system w/o having to edit the configuration and restart the daemon…

mysql> SET GLOBAL general_log = 1;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'general%';
+------------------+---------------------------------+
| Variable_name    | Value                           |
+------------------+---------------------------------+
| general_log      | ON                              |
| general_log_file | /var/lib/mysql/query.log        |
+------------------+---------------------------------+

mysql> SET GLOBAL general_log = 0;
Query OK, 0 rows affected (0.00 sec)

updated: 2012-01-08