Use mysql client connect to server
#show variables like 'general%';
+------------------+----------------------------+
| Variable_name | Value |
+------------------+----------------------------+
| general_log | OFF |
| general_log_file | /var/run/mysqld/mysqld.log |
+------------------+----------------------------+
This 2 vaiables control mysql query logging.
To turn query log on :
SET GLOBAL general_log_file = '/var/log/mysql/sql-log.log' ;
SET GLOBAL general_log = 1
To turn query log off :
SET GLOBAL general_log = 0 ;
SET GLOBAL general_log_file = '/var/run/mysqld/mysqld.log';
Notice: This is for mysql 5.1 only. For mysql 5.0, those variable is not available. you need editing my.cnf and restart.