前言
实验:通过 Canal 解析 MySql 的 binlog,获取sql
一、准备
本实验在之前配置上进行 https://blog.csdn.net/fanfan4569/article/details/80806996
采用的 Canal版本,https://github.com/alibaba/canal/issues/574
<dependency>
<groupId>com.alibaba.otter</groupId>
<artifactId>canal.client</artifactId>
<version>1.0.24</version>
</dependency>
二、修改MySql中 binlog_format
查看binlog_format
show variables like 'binlog_format'
(1)在配置文件 my.cnf
中更改
(2)直接更改
set globle binlog_format='MIXED'
三、添加代码
在之前的代码中添加
String sql = rowChage.getSql();
System.out.println("SQL : " + sql);
四、测试
启动canal客户端 ./bin/startup.sh
开启项目应用
五、参考资料
https://www.abcdocker.com/abcdocker/213
https://github.com/alibaba/canal/issues/574
https://blog.csdn.net/ouyang111222/article/details/50300851
最后
以上就是专一玫瑰最近收集整理的关于【Canal】之 Binlog Mixed模式的全部内容,更多相关【Canal】之内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复