当前位置:网站首页>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
- LeetCode - 025. 链表中的两数相加
- [Virtualization Ecological Platform] Platform Architecture Diagram & Ideas and Implementation Details
- 「R」使用ggpolar绘制生存关联网络图
- 蓝牙协议栈开发板 STM32F1 跑蓝牙协议栈 –传统蓝牙搜索演示以及实现原理[通俗易懂]
- keras自带数据集(横线生成器)
- deeplab implements its own remote sensing geological segmentation dataset
- xmind使用指南(XMind具有下列哪些功能)
- Docker practical experience: Deploy mysql8 master-slave replication on Docker
- 一、excel转pdf格式jacob.jar
猜你喜欢

MySQL 行级锁(行锁、临键锁、间隙锁)

【虚拟化生态平台】平台架构图&思路和实现细节

Shengxin Weekly Issue 38

无法将“node.exe”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。

三六零与公安部三所发布报告:关基设施保护成为网络安全博弈关键

AWS亚马逊云账号注册,免费申请12个月亚马逊云服务器详细教程

Docker搭建Mysql主从复制

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

学自动化测试哪个培训机构好 试听课程后就选了这个地方学习

“带薪划水”偷刷阿里老哥的面经宝典,三次挑战字节,终成正果
随机推荐
strings包详细文档+示例
Mysql环境变量的配置(详细图解)
应用层基础 —— 认识URL
瑞吉外卖项目:新增菜品与菜品分页查询
xmind使用指南(XMind具有下列哪些功能)
Summary of several defragmentation schemes for MySQL (to solve the problem of not releasing space after deleting a large amount of data)
mysql 自动添加创建时间、更新时间
数据持久化技术——MP
"JUC Concurrent Programming - Advanced" 06 - Immutability of Shared Models (Design of Immutable Classes | Use of Immutable Classes | Flyweight Pattern)
Docker安装canal、mysql进行简单测试与实现redis和mysql缓存一致性
Is the working process of the belt you know the story - actionreducerstore
拥抱趋势!阿里这套微服务开源框架权威手册,实战到底层细致清晰
AWS Amazon cloud account registration, free application for 12 months Amazon cloud server detailed tutorial
【Web技术】1397- 深入浅出富文本编辑器
Use Excel to read data exposed by SAP ABAP CDS View through ODBC
分布式id解决方案
第十二章 使用中的 OpenAPI 属性
一、excel转pdf格式jacob.jar
lotus-local-net 2k v1.17.0-rc4
Intranet Penetration Learning (IV) Domain Lateral Movement - SMB and WMI Service Utilization