问题:
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.
数据库连接失败
解决:
mysql版本:5.x
spring.datasource.url=jdbc:mysql://localhost:3306/resource_sharingdb?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true

本文针对Spring Boot应用中遇到的CommunicationsException,详述了MySQL 5.6版本连接失败的问题,提供了设置URL参数和排查步骤,助你快速解决数据库连接问题。
2961

被折叠的 条评论
为什么被折叠?



