当前位置:网站首页>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. 小结
边栏推荐
- Docker build Mysql master-slave replication
- ApiPost is really fragrant and powerful, it's time to throw away Postman and Swagger
- 一、excel转pdf格式jacob.jar
- MySQL index usage and optimization
- Docker搭建Mysql主从复制
- 如何正确地把服务器端返回的文件二进制流写入到本地保存成文件
- [Virtualization Ecological Platform] Platform Architecture Diagram & Ideas and Implementation Details
- Different lower_case_table_names settings for server (‘1‘) and data dictionary (‘0‘) 解决方案
- xmind使用指南(XMind具有下列哪些功能)
- Cloudera Manager —— 端到端的企业数据中心管理工具
猜你喜欢

Android studio connects to MySQL and completes simple login and registration functions

If the value of the enum map does not exist, deserialization is not performed

一文吃透接口调用神器RestTemplate

Cloudera Manager —— 端到端的企业数据中心管理工具

Initial JDBC programming

若枚举映射的值不存在,则不进行反序列化

IDEA configure method annotation automatic parameters

Many mock tools, this time I chose the right one

2022/7/28

Candence学习篇(11) allegro中设置规则,布局,走线,铺铜
随机推荐
《MySQL高级篇》五、InnoDB数据存储结构
生命不息,刷题不止,简单题学习知识点
mpu9150(driverack pa简明教程)
Docker实践经验:Docker 上部署 mysql8 主从复制
How to correctly write the binary stream of the file returned by the server to the local file and save it as a file
[Go Affair] See through Go's collections and slices at a glance
502 bad gateway原因、解决方法
三六零与公安部三所发布报告:关基设施保护成为网络安全博弈关键
瑞吉外卖项目:新增菜品与菜品分页查询
基于Multisim的函数信号发生器–方波、三角波、正弦波[通俗易懂]
分布式事务Seata详细使用教程
Read through the interface to call the artifact RestTemplate
瑞吉外卖项目:文件的上传与下载
【软件工程之美 - 专栏笔记】33 | 测试工具:为什么不应该通过QQ/微信/邮件报Bug?
The latest MySql installation teaching, very detailed
音视频基础
502 bad gateway causes and solutions
使用内存映射加快PyTorch数据集的读取
After class, watching the documentation and walking back to the lab, I picked up the forgotten SQL operators again
Distributed Transactions - Introduction to Distributed Transactions, Distributed Transaction Framework Seata (AT Mode, Tcc Mode, Tcc Vs AT), Distributed Transactions - MQ