com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed

一开始以为是jar没导进来  maven clear    install 一下 还是那样  

找了一些解决方案

 

发现是MySQL 8.0 版本 的问题 

需要在后面加  allowPublicKeyRetrieval=true

一开始是  

url: jdbc:mysql://localhost:8858/*****?useUnicode=true&characterEncoding-utr-8&useSSL=false

更正后 后面 加上

&allowPublicKeyRetrieval=true

可执行-->

 

posted @ 2020-11-16 20:27  喜欢22度的晴天  阅读(1736)  评论(0编辑  收藏  举报