View MySQL query log

http://dev.mysql.com/doc/refman/5.1/en/query-log.html

 

mysql> SHOW VARIABLES LIKE "general_log%";
+------------------+-----------------------------+
| Variable_name    | Value                       |
+------------------+-----------------------------+
| general_log      | OFF                         |
| general_log_file | /var/lib/mysql/neqali50.log |
+------------------+-----------------------------+
2 rows in set (0.00 sec)

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

mysql> SHOW VARIABLES LIKE "general_log%";
+------------------+-----------------------------+
| Variable_name    | Value                       |
+------------------+-----------------------------+
| general_log      | ON                          |
| general_log_file | /var/lib/mysql/neqali50.log |
+------------------+-----------------------------+
2 rows in set (0.00 sec)

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

mysql> SHOW VARIABLES LIKE "general_log%";
+------------------+-----------------------------+
| Variable_name    | Value                       |
+------------------+-----------------------------+
| general_log      | OFF                         |
| general_log_file | /var/lib/mysql/neqali50.log |
+------------------+-----------------------------+
2 rows in set (0.00 sec)

mysql> exit