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

可执行-->
原文地址:https://www.cnblogs.com/Mr-Y1907/p/13986987.html