java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed的解决

慈云数据 2024-05-30 技术支持 53 0

一、异常的产生

java.sql.SQLNonTransientConnectionException:

java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed的解决
(图片来源网络,侵删)

Public Key Retrieval is not allowed   表明正在使用的 JDBC 驱动在尝试建立数据库连接时,无法通过公钥检索方式获取服务器SSL证书。通常发生在mysql8等高版本上

二、解决

配置数据库信息

java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed的解决
(图片来源网络,侵删)

1.url配置了SSL

2.url中添加 allowPublicKeyRetrieval=true

    url: jdbc:mysql://localhost:3306/study?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
微信扫一扫加客服

微信扫一扫加客服

点击启动AI问答
Draggable Icon