当前位置:网站首页>MySQL日志中“binlog”的三种格式玩起来真爽
MySQL日志中“binlog”的三种格式玩起来真爽
2022-07-31 11:41:00 【InfoQ】
1. binlog
2. 配置 binlog


2.1 binlog 的格式
2.1.1 Statement
2.2.2 Row
2.2.3 Mixed
2.2 配置
2.2.1 开启 binlog

# 这个参数表示启用 binlog 功能,并指定 binlog 的存储目录log-bin=javaboy_logbin# 设置一个 binlog 文件的最大字节# 设置最大 100MBmax_binlog_size=104857600# 设置了 binlog 文件的有效期(单位:天)expire_logs_days = 7# binlog 日志只记录指定库的更新(配置主从复制的时候会用到)#binlog-do-db=javaboy_db# binlog 日志不记录指定库的更新(配置主从复制的时候会用到)#binlog-ignore-db=javaboy_no_db# 写缓存多少次,刷一次磁盘,默认 0 表示这个操作由操作系统根据自身负载自行决定多久写一次磁盘# 1 表示每一条事务提交都会立即写磁盘,n 则表示 n 个事务提交才会写磁盘sync_binlog=0# 为当前服务取一个唯一的 id(MySQL5.7 之后需要配置)server-id=1

docker restart mysql1


2.2.2 修改 binlog_format



3. 常见 binlog 操作
- 查看所有 binlog 日志
show master logs;

- 查看 master 状态

- 刷新 binlog

- 重置 binlog

- 查看 binlog


show binlog events [IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count];
show binlog events in 'javaboy_logbin.000001';

5. 小结
边栏推荐
- IDEA configure method annotation automatic parameters
- mysql automatically adds creation time and update time
- Master SSR
- lotus-local-net 2k v1.17.0-rc4
- 透过开发抽奖小程序,体会创新与迭代
- 文件包含漏洞
- How to correctly write the binary stream of the file returned by the server to the local file and save it as a file
- [Virtualization ecological platform] Raspberry Pi installation virtualization platform operation process
- Threading(in thread main)
- In Excel using ODBC consumer SAP ABAP CDS view
猜你喜欢
Docker搭建Mysql主从复制
The latest MySql installation teaching, very detailed
Data Persistence Technology - MP
mysql 索引使用与优化
学习爬虫之Scrapy框架学习(1)---Scrapy框架初学习及豆瓣top250电影信息获取的实战!
redis-enterprise use
[Virtualization Ecological Platform] Platform Architecture Diagram & Ideas and Implementation Details
生信周刊第38期
透过开发抽奖小程序,体会创新与迭代
Summary of several defragmentation schemes for MySQL (to solve the problem of not releasing space after deleting a large amount of data)
随机推荐
cesium-Web网页优化进阶
Many mock tools, this time I chose the right one
安装MYSQL遇到问题:write configuration file卡主
kubernetes之服务发现
MySQL row-level locks (row locks, adjacent key locks, gap locks)
台达PLC出现通信错误或通信超时或下载时提示机种不符的解决办法总结
CWE4.8 -- 2022年危害最大的25种软件安全问题
【Web技术】1397- 深入浅出富文本编辑器
Curl 命令使用
【虚拟化生态平台】树莓派安装虚拟化平台操作流程
B/S架构模式的一个整体执行流程
IDEA 配置方法注释自动参数
Data Persistence Technology - MP
最新MySql安装教学,非常详细
Life is endless, there are more questions, simple questions to learn knowledge points
AWS亚马逊云账号注册,免费申请12个月亚马逊云服务器详细教程
Detailed tutorial on distributed transaction Seata
DCM 中间件家族迎来新成员
2022/7/28
在 Excel 内使用 ODBC 消费 SAP ABAP CDS view