问题来源:
今天在学习mybatis时,遇到的一个问题
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server
canal是阿里巴巴开源的数据同步工具,相关简介及工作原理参见官网:阿里canal官方介绍 本文主要介绍使用cannal实现Mysql数据库间的数据同步。
一、 canal环境搭建
canal的原理是基于mysql binlog技术,所以这里一定需要开启mysql的binlog写入功能。
(1)检查binlog写入功能是否开启
mysql> show variables like 'log_bin';
+---------------+-------+
| Varia