com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failureThe last packet s
·
记录一下今天使用java连接部署在docker容器里的mysql遇到的问题,刚开始以为的跟正常的连接一样,结果报错
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
弄了有一会,发现还是没用,最后在一篇博客发现原来是配置上要加上
?useSSL=false
需要添加参数useSSL=false,或者配置ssl
即
spring.datasource.url=jdbc:mysql://192.168.6.128:3306/user?useSSL=false
就OK了
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)