配置文件:
主要是Driver的配置应该为
com.mysql.cj.jdbc.Driver
其次若遇上时区乱码则需要加上serverTimezone=GMT&characterEncoding=UTF-8
application.yml的配置示例
代码语言:javascript复制spring:
datasource:
username: root
password: 123456
url: jdbc:mysql://localhost:3306/springboot_jdbc?serverTimezone=GMT&characterEncoding=UTF-8
driver-class-name: com.mysql.cj.jdbc.Driver