0
点赞
收藏
分享

微信扫一扫

Path does not chain with any of the trust anchors

夏木之下 2022-09-06 阅读 87


db.properties中原代码

# 数据库连接
driverClassName=com.mysql.Driver
url=jdbc:mysql://127.0.0.1:3306/aaa?useUnicode=true&characterEncoding=utf8&useSSL=true
username=root
password=123123
#
initialSize=5
maxActive=20
minIdle=5
maxIdle=10
filters=stat,wall,log4j

报错信息

Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
at sun.security.provider.certpath.PKIXCertPathValidator.validate(PKIXCertPathValidator.java:154)
at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:80)
at java.security.cert.CertPathValidator.validate(CertPathValidator.java:292)
at com.mysql.jdbc.ExportControlled$X509TrustManagerWrapper.checkServerTrusted(ExportControlled.java:295)
... 36 more
ERROR [Druid-ConnectionPool-Create-652211881] - create connection SQLException, url: jdbc:mysql://127.0.0.1:3306/jin1?useUnicode=true&characterEncoding=utf8&useSSL=true, errorCode 0, state 08S01
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:

解决方案

//解决方案1:
url=jdbc:mysql://127.0.0.1:3306/aaa?useUnicode=true&characterEncoding=utf8
//解决方案2:
url=jdbc:mysql://127.0.0.1:3306/aaa?useUnicode=true&characterEncoding=utf8&useSSL=false

把useSSL=true删除 或者 把useSSL=false


举报

相关推荐

0 条评论