Canal 启动报错Caused by: java.io.IOException: caching_sha2_password Auth failed

Posted 在奋斗的大道

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Canal 启动报错Caused by: java.io.IOException: caching_sha2_password Auth failed相关的知识,希望对你有一定的参考价值。

启动Canal 后,报错信息:

2023-02-06 15:51:54.276 [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
Caused by: java.io.IOException: connect /127.0.0.1:3306 failure
    at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:85)
    at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.connect(MysqlConnection.java:89)
    at com.alibaba.otter.canal.parse.inbound.mysql.MysqlEventParser.preDump(MysqlEventParser.java:87)
    at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:176)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: caching_sha2_password Auth failed
    at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.negotiate(MysqlConnector.java:260)
    at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:82)
    ... 4 more

产生原因:

自MySQL 8.0.3开始,身份验证插件默认使用caching_sha2_password

解决办法:

修改canal用户对应的身份验证插件为mysql_native_password

select host,user,plugin from mysql.user ;

ALTER USER 'canal'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

以上是关于Canal 启动报错Caused by: java.io.IOException: caching_sha2_password Auth failed的主要内容,如果未能解决你的问题,请参考以下文章

elaseticsearchelaseticsearch启动报错Caused by: org.elasticsearch.transport.BindTransportException: Fai(代

Caused by: java.lang.NoClassDefFoundError: com/google/common/base/MoreObjects

Spring与JDK版本不一致引发问题Caused by: java.lang.IllegalArgumentException

解决Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory

解决sqoop导入报错:Caused by: java.sql.SQLException: Protocol violation

JDK运行报错:Caused[0] by NoSuchMethodError: java.nio.IntBuffer.rewind()Ljava