一、報錯
com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
CommunicationsException?翻譯為:通信鏈路故障
二、原因
但是在mysql高版本中,如果在URL中缺少"useSSL=false"參數(shù)可能會導致報錯。這是因為MySQL 8.0.33以上的版本默認要求使用SSL(安全套接層)來加密與數(shù)據(jù)庫的連接。
三、解決
在數(shù)據(jù)源配置文件中,在url后加上useSSL=false文章來源:http://www.zghlxwxcb.cn/news/detail-856414.html
url: jdbc:mysql://192.168.189.189:3306/xxxx?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai&useSSL=false
重新啟動后,問題解決!文章來源地址http://www.zghlxwxcb.cn/news/detail-856414.html
到了這里,關(guān)于com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!