当前位置:网站首页>【mysql学习笔记33】日志
【mysql学习笔记33】日志
2022-07-15 16:06:00 【yqs_281876918】
错误日志
mysql的错误日志记录了mysql运行过程中(包括启动和停止)发生的任何严重错误。
该日志默认是开启状态,可以通过show variables like '%log_error%'语句来查看日志位置
二进制日志
定义
二进制日志记录了所有的DDL语句和DML语句
作用
数据恢复,主从复制
配置信息
可以通过 show variables like %log_bin%查看相关信息
格式
| 日志格式 | 含义 |
|---|---|
| STATEMENT | 基于SQL语句的日志记录,记录的是SQL语句,对数据进行修改的SQL都会存在日志中 |
| ROW | 基于行的日志几里路,记录了每一行的数据变更 |
| MIXED | 混合了以上两种 |
show variables like ‘%binlog_format’;
查看日志内容
mysqlbinlog [参数选项] filename
-d 查看指定数据库的日志
-o 忽略前n行命令
-v 将行事件重构为SQL语句
-w 将行事件重构为SQL语句,并输出注释信息
日志删除
reset master 清空全部日志
purge master logs to ‘binlog.******’ 删除指定编号之前的所有日志
purge master logs before ‘yyyy-mm-dd hh24:mm:ss’ 删除指定时间点之前的所有日志
设置过期时间
show variables like ‘%binlog_expire_logs_seconds%’;
查询日志
介绍
查询日志记录了客户端的所有操作语句,而二进制日志不包含DQL
相关配置
show variables like ‘%general%’;
慢查询日志
介绍
慢查询日志记录了所有执行时间超过long_query_time并且扫描记录数大于等于min_examined_row_limit的所有SQL语句日志,默认不开启。
边栏推荐
- 迪文串口屏教程(3)
- 2022安全员-C证特种作业证考试题库及答案
- 深度学习基础:8.卷积与池化
- Is it a transliteration of loanwords or does it have a specific meaning?
- 2022年安全员-A证考试题目及在线模拟考试
- 什么是真正的HTAP?(一)背景篇
- 理财平台选择哪个安全可靠
- Double data rate synchronous dynamic random access memory (DDR SDRAM)
- [computing talk club] Lecture 6 | Sanxingdui fantasy trip: an experience that only cloud computing can bring
- 利用 JMeter 压测上传和下载接口实战
猜你喜欢

Xiamarin integrates braze to realize messaging and end-to-end notification

What's the use of games| Game application value research case collection

Intensive reading of the paper: deep reinforcement learning and intelligent transportation (I)

单视图重构—影消点、影消线与相机内参、平面法向量的推导

Pychart tutorial: 5 very useful tips

IM即时通讯软件开发之扫码登录功能

在线问题反馈模块实战(三):自动生成所有Controller、Service、Mapper等文件
![[2022 wechat applet demining] how to correctly obtain openid in cloud development and non cloud development environments?](/img/36/b930cb179b60f5a31b119b7fb4c3f7.jpg)
[2022 wechat applet demining] how to correctly obtain openid in cloud development and non cloud development environments?

深度学习基础:9.复现经典网络:LeNet5与AlexNet

因员工将密码设为“123456”,AMD 被盗 450Gb 数据?
随机推荐
三维重建之线结构光(一)
[2022 wechat applet demining] how to correctly obtain openid in cloud development and non cloud development environments?
牛啊!2小时复现顶会论文,他的秘诀是——
阿里内网疯传的P8“顶级”分布式架构手册被我拿到了
運維-技能大雜燴
Intensive reading of the paper: deep reinforcement learning and intelligent transportation (I)
Beihang & Institute of Information Technology & meituan proposed lbdt, which is based on spatiotemporal interaction of language bridging to accurately segment directional video objects, with performan
Engineering monitoring vibrating wire wireless acquisition instrument external digital sensor access logic and data transmission
中国人力资源数字化生态图谱-灵活用工市场
Establishing SSL connection without server‘s identity verification is not recommended
不知道如何提高视觉语言大模型?浙大与联汇研究院提出新型多维度评测框架
让企业数字化砸锅和IT主管背锅的软件供应链安全风险指北
论文精读: 深度强化学习与智慧交通(一)
Xiamarin integrates braze to realize messaging and end-to-end notification
讓企業數字化砸鍋和IT主管背鍋的軟件供應鏈安全風險指北
量子计算+半导体材料!Quantinuum和JSR达成合作
How does win11 set the multitask window? Win11 method of setting multi task window
Qdu summer training - warm up match
Loj#510-「LibreOJ NOI Round #1」北校门外的回忆【线段树】
深度学习基础:9.复现经典网络:LeNet5与AlexNet