- 查看日志开关
mysql> show variables like 'general_log';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| general_log | OFF |
+---------------+-------+
1 row in set (0.01 sec)
- 查看log文件位置
mysql> show variables like 'general_log_file';
+------------------+------------------------------------------------+
| Variable_name | Value |
+------------------+------------------------------------------------+
| general_log_file | /usr/local/mysql/data/xuanweideMacBook-Air.log |
+------------------+------------------------------------------------+
1 row in set (0.01 sec)
- 设置开关
mysql> set global general_log=on;
Query OK, 0 rows affected (0.06 sec)
mysql> show variables like 'general_log';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| general_log | ON |
+---------------+-------+
1 row in set (0.00 sec)
网友评论