当前位置:网站首页>mysql 之general_log日志
mysql 之general_log日志
2022-07-23 09:25:00 【privateobject】
为了查看mysql登录日志,百度搜索没找到,只找到mysql日志开启,显示所有操作记录(含连接数据、执行sql等)
为了性能考虑,一般general log不开启。slow log定位有性能问题sql,而general log会记录所有SQL。有时生产上的mysql性能问题,短时间开启general log,获取sql执行情况,对排查和分析mysql性能问题,有很大的帮助。或者有时,不清楚执行了什么sql语句,但又要排错,找不到原因情况下,也可以短暂开启这个general log日志的。
mysql5.0,如果要开启slow log、general log,需重启,从MySQL5.1.6开始,general query log和slow query log支持写到文件或者数据库表两种方式,并且日志的开启,输出方式的修改,可以Global级别动态修改。
参考
mysql 之general_log日志开启详解以及清空
mysql中general_log日志知识点介绍
mysql安全审计,记录mysq的用户的登陆日志
操作
-- general_log日志 开启状态
show global variables like 'general_log';
-- general_log日志 记录方式 文件
show global variables like 'log_output';
-- general_log日志 记录方式 改为表级别
set global log_output = 'TABLE';
-- general_log日志 开启
set global general_log = on;
-- 切换数据库
use mysql;
-- 查看是否有记录表
show tables like 'general_log';
-- 使用工具登录几次mysql
select * from general_log where command_type = 'Connect';




边栏推荐
猜你喜欢

JS texture style pie chart plug-in

Can bus quick understanding

mysql唯一索引无重复值报错重复

什么是Per-Title编码?
![[applet automation minium] III. element positioning - use of wxss selector](/img/ec/51eadd08bea18f8292aa3521f11e8a.png)
[applet automation minium] III. element positioning - use of wxss selector

C# 线程锁和单多线程简单使用

C language project practice: 24 point game calculator (based on knowledge points such as structure, pointer, function, array, loop, etc.)

About flex layout justify content: the last solution to the misalignment of space around and why it is solved like this is a discussion

21 - 二叉树的垂直遍历
![[can I do your first project?] Detailed introduction and Simulation Implementation of gzip](/img/92/dfef5887e2313f8025baf11c8f4379.png)
[can I do your first project?] Detailed introduction and Simulation Implementation of gzip
随机推荐
云呐|怎样管理固定资产?如何进行固定资产管理?
【小程序自动化Minium】三、元素定位- WXSS 选择器的使用
右键新建txt,新建文本文件不见了,通过添加注册表就可以解决,找来找去办法解决不了的终极办法
建议思源笔记能够兼容第三方同步盘
生成订单号
云呐|公司固定资产如何管理?公司固定资产如何管理比较好?
Towhee weekly model
Ffmpeg 2 - use of ffplay, ffprobe, ffmpeg commands
Ffmpeg 1 - Overview / installation
10 years of software testing engineer experience, very confused
Work notes: one time bag grabbing
10年软件测试工程师经验,很茫然....
全志F1C100S/F1C200S学习笔记(13)——LVGL移植
(heavy chain dissection) Magic Tree
【FLink】FLink Hash collision on user-specified ID “opt“. Most likely cause is a non-unique ID
手工测试如何转向自动化测试?字节5年自动化经验浅谈一下...
【软件测试】盘一盘工作中遇到的 MQ 异常测试
[C language] number guessing game + shutdown applet
C语言入门实战(11):输入一组正整数,求逆序数的和
CPU, memory, disk speed comparison