We can view the mysql query and activity by the same,
Please see,
mysql> set global general_log='ON';
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like 'general_log%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| general_log | ON |
| general_log_file | OFF |
+------------------+-------+
2 rows in set (0.00 sec)
mysql> set global general_log_file='/var/lib/mysql/mysql.log';
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/mysql.log |
+------------------+--------------------------+
2 rows in set (0.00 sec)
mysql> Ctrl-C -- exit!
Aborted
root@cpanel [~]# touch /var/lib/mysql/mysql.log
root@cpanel [~]# chown mysql. /var/lib/mysql/mysql.log
Please see,
mysql> set global general_log='ON';
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like 'general_log%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| general_log | ON |
| general_log_file | OFF |
+------------------+-------+
2 rows in set (0.00 sec)
mysql> set global general_log_file='/var/lib/mysql/mysql.log';
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/mysql.log |
+------------------+--------------------------+
2 rows in set (0.00 sec)
mysql> Ctrl-C -- exit!
Aborted
root@cpanel [~]# touch /var/lib/mysql/mysql.log
root@cpanel [~]# chown mysql. /var/lib/mysql/mysql.log
Comments
Post a Comment