关于Mysql8连接失败localhost 拒绝了我们的连接请求
关于Mysql8连接失败localhost 拒绝了我们的连接请求
用了mysql8,什么事情都要长点心了,今天配置yml时候,一波配置给上之后发现
失败代码如下
server:
port: 8084
spring:
datasource:
url: jdbc:mysql://localhost:3306/ds0
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
加点东西轻松就搞定了,长点记性就好啦
server:
port: 8084
spring:
datasource:
url: jdbc:mysql://localhost:3306/ds0?serverTimezone=GMT%2B8&autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=true
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
jpa:
show-sql:true