当前位置:网站首页>MySQL enable logging
MySQL enable logging
2022-06-29 07:52:00 【Mzz steed】
Turn on general_log journal
mysql> set global general_log=on; -- Open log
Query OK, 0 rows affected (2.60 sec)
mysql> show variables like 'general_log';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| general_log | ON |
+---------------+-------+
1 row in set (0.00 sec)
mysql> set global general_log_file='/opt/sudytech/mysql/data/general.log'; -- Specify the log generation location
Query OK, 0 rows affected (0.05 sec)
mysql> show variables like 'general_log_file';
+------------------+--------------------------------------+
| Variable_name | Value |
+------------------+--------------------------------------+
| general_log_file | /opt/sudytech/mysql/data/general.log |
+------------------+--------------------------------------+
1 row in set (0.04 sec)
because log_output The default value is FILE. So there's no need to modify .
see /opt/sudytech/mysql/data/ The directory has produced general.log journal
[[email protected] data]# pwd
/opt/sudytech/mysql/data
[[email protected] data]# tail -f general.log
2021-05-18T06:45:32.140829Z 2 Query set global general_log=OFF
/opt/sudytech/mysql/bin/mysqld, Version: 5.7.32-log (MySQL Community Server (GPL)). started with:
Tcp port: 3306 Unix socket: /tmp/mysql.sock
Time Id Command Argument
2021-05-18T10:43:17.049473Z 3 Query show variables like 'general_log'
2021-05-18T10:44:09.060990Z 3 Query set global general_log_file='/opt/sudytech/mysql/data/general.log'
/opt/sudytech/mysql/bin/mysqld, Version: 5.7.32-log (MySQL Community Server (GPL)). started with:
Tcp port: 3306 Unix socket: /tmp/mysql.sock
Time Id Command Argument
2021-05-18T10:44:18.375549Z 3 Query show variables like 'general_log_file'
......
Permanent changes need to be made in my.cnf in [mysqld] add to
general_log = 1
general_log_file=/opt/sudytech/mysql/data/general.log
边栏推荐
猜你喜欢

Protobuf 二进制文件学习及解析

Detailed design of PLC program control system for washing machine

SQL injection bypass (6)

Interviewer: why does database connection consume resources? Where are the resources consumed?

VMware vcenter/ESXI系列漏洞总结

Handle series - install spotbugs and use them quickly

Wechat applet learning notes (summer vacation)

VSLAM特征之线特征&面特征

【深度之眼吴恩达机器学习作业班第四期】逻辑回归编程实现

Detailed explanation of top and free commands
随机推荐
Alicloud access resource: nosuchkey
自动化测试 - uiautomator2框架应用 - 自动打卡
数组知识点小结
Vulnhub's dc7 target
产品安全 - 小漏洞导致大问题
cv2.cvtColor
719. find the distance of the number pair with the smallest K (two points)
Explanation of swing transformer theory
Detailed design of PLC program control system for washing machine
Kingbasees v8r6 cluster maintenance case -- single instance data migration to cluster case
C actual combat - high configuration version of Snake game design
Appium 环境搭建
从Nacos客户端谈Nacos配置中心
C#导入csv到mysql数据库中
【深度之眼吴恩达机器学习作业班第四期】逻辑回归编程实现
Schnuka: 3D visual recognition system 3D visual inspection principle
Kyushu cloud helps Inner Mongolia's "counting from the east to the west" project to drive the smart new ecology of the surveying and mapping industry
Postman pre request
ROS当中的仿真时间以及Bag包操作
【工控老马】单片机与西门子S7-200通信原理详解