当前位置:Gxlcms > 数据库问题 > 通过dbcp链接池对数据库操作报 Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)--解决方案

通过dbcp链接池对数据库操作报 Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)--解决方案

时间:2021-07-01 10:21:17 帮助过:8人阅读


at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:394)
at sun.security.ssl.InputRecord.read(InputRecord.java:376)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1328)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:149)
... 55 more

----------我们重点关注红色字体部分,很明显是因为ssl引起的

我的MySql版本为5.7,新装的,没有配MySQL SSL,但是连接池链接的时候默认加密了,所以一直连不上,解决方案如下:

url=jdbc:mysql://192.168.80.128:3301/dream?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false

在配置JDBC链接串时把&useSSL=false加上,不使用SSL加密,配置后连接正常,如果安全性较高的数据建议在MySQL端还是把SSL配上。

 

通过dbcp链接池对数据库操作报 Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)--解决方案

标签:

人气教程排行