[Solved] Canal 1.1.5 Startup Error: caching_sha2_password Auth failed

1. Phenomenon

java.io.IOException: caching_sha2_password Auth failed
        at 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. Analysis and positioning

Since MySQL 8.0.3, the authentication plug-in uses caching by default_sha2_password

3. Solution

Solution: modify the authentication plug-in corresponding to the canal user to MySQL_native_password

mysql> select host,user,plugin from mysql.user ;
mysql> ALTER USER 'canal'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

renderings

Read More: