文章目录
- 1. 现象
- 2. 分析定位
- 3. 解决方案
- 效果图
1. 现象
java.io.IOException: caching_sha2_password Auth failedat com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.negotiate(MysqlConnector.java:260) ~[canal.parse.driver-1.1.5.jar:na]at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:82) ~[canal.parse.driver-1.1.5.jar:na]... 4 common frames omitted
2021-11-20 16:43:40.852 [destination = example , address = /127.0.0.1:3306 , EventParser] ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:example[com.alibaba.otter.canal.parse.exception.CanalParseException: java.io.IOException: connect /127.0.0.1:3306 failure
2. 分析定位
自MySQL 8.0.3开始,身份验证插件默认使用caching_sha2_password
3. 解决方案
解决:修改canal用户对应的身份验证插件为mysql_native_password
mysql> select host,user,plugin from mysql.user ;
mysql> ALTER USER 'canal'@'%' IDENTIFIED WITH mysql_native_password BY 'password';