在yml里写的url路径是可以用的,但是当把配置写到nacos配置中心的时候就报错 com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure 以下是我的原配置 注意url #spring: # datasource: # druid: # driver-class-name: com.mysql.cj.jdbc.Driver # url: jdbc:mysql://xxxx:3306/gulimall_sms?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # username: root # password: root
以下报错截图
针对这个问题 只需要在配置url加上
&useSSL=false
即可解决