当前位置:网站首页>mysql 开启日志功能
mysql 开启日志功能
2022-06-29 06:41:00 【MZZ骏马】
开启general_log日志
mysql> set global general_log=on; --开启日志
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'; --指定日志产生位置
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)
由于log_output默认值为FILE。所以不需要修改。
查看/opt/sudytech/mysql/data/目录下已经产生了general.log日志
[[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'
......
永久修改需要在my.cnf中[mysqld]添加
general_log = 1
general_log_file=/opt/sudytech/mysql/data/general.log
边栏推荐
猜你喜欢

【工控老马】PLC六路抢答器系统设计详解

【工控老马】基于PLC的花样喷泉设计原理详解

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

Detailed explanation of top and free commands

Appium自动化测试基础 — ADB常用命令(二)

软件测试鸾音鹤信

Viewing application and installation of Hana database license

呕心沥血总结出来的MySQL常见错误以及解决方法(二)
![[old horse of industrial control] detailed explanation of Siemens PLC s7-300scl programming](/img/da/08f23cfe7f8759b73576eb0638fec5.png)
[old horse of industrial control] detailed explanation of Siemens PLC s7-300scl programming

matlab simulink 电网扫频仿真和分析
随机推荐
358. K 距离间隔重排字符串 排序
自动化测试 - uiautomator2框架应用 - 自动打卡
指针引用数组元素
Common MySQL errors and solutions summarized painstakingly (I)
数组知识点小结
Detailed design of PLC program control system for washing machine
Kingbasees coping with transaction rollback caused by too fast growth of table age
[translation] swarmed out. Design methods for building modern applications
Schnuka: 3D visual inspection scheme 3D visual inspection application industry
from xx import*等价于from xx import *,不一定要加空格
基于Sophus的Ceres优化
js异或混淆代码
matlab 多普勒效应产生振动信号和处理
C actual combat - high configuration version of Snake game design
4年工作经验,多线程间的5种通信方式都说不出来,你敢信?
tf. compat. v1.global_ variables
声波通讯 - 流式数据处理 - 窗口对齐
KingbbaseES V8R6集群维护案例之---集群之间数据迁移
TF. Repeat and stack operations of slim
Appium自动化测试基础 — ADB常用命令(二)