Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

异常:org.apache.ibatis.exceptions.PersistenceException:

image

出现问题的原因

userSSL=true

解决方案

数据库连接池的userSSL=falss,或者不写这个属性;如图
image
好了,现在可以运行了
image

问题总结

UserSSL不知道不要乱用
我用的是mysql5.7,可以不用设置这个属性,一般JDBC版本与MySQL版本不兼容,MySQL的版本更高一些,在连接语句后加上“useSSL=‘true’” ,就可以连接到数据库了。更高版本
UserSSL的作用请参考
https://my.oschina.net/Gitstone/blog/4441035

探讨

我mysq5.7设置UserSSL=true为啥会出现这样的问题呢?万一有情况必须要设置UserSSL这种情况怎么办?请大家积极留言,多多探讨
2021-05-19 17:44:45 星期三

posted @ 2021-05-19 17:48  loveYuJie  阅读(749)  评论(0)    收藏  举报