java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed

mysql8.x版本的数据库在连接的时候报错java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
只要在url的后边加上allowPublicKeyRetrieval=true即可

jdbc:mysql://localhost:3306/test?serverTimezone=GMT&allowPublicKeyRetrieval=true&useSSL=false&characterEncoding=utf8;
 


————————————————
版权声明:本文为CSDN博主「年少轻与狂」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_44415928/article/details/104095942

原文地址:https://www.cnblogs.com/javalinux/p/15239607.html