mysql8.x 和maxwell结合报错 Public Key Retrieval is not allowed

使用maxwell实时同步mysql的binlog日志,host数据存储在mysql8上,maxwell启动时报错:Could not connect to jdbc:mysql://X.X.X.249:3306?connectTimeout=5000&zeroDateTimeBehavior=convertToNull&useSSL=false&characterEncoding=UTF-8&tinyInt1isBit=false: Public Key Retrieval is not alloweds

官网解释:https://mysql-net.github.io/MySqlConnector/connection-options/

网上解释说需要加上:allowPublicKeyRetrieval=true

在maxwell最新版本(1.22)的官网上找了半天没有相关的参数,于是在MaxwellMysqlConfig.java文件中添加如下

this.jdbcOptions.put("allowPublicKeyRetrieval", "true");

再次启动OK!

猜你喜欢

转载自www.cnblogs.com/liugui/p/10944019.html