SpringBoot 配置MySql5和8的驱动

MySql 5:

spring:
  datasource:
    driverClassName: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/mp?useUnicode=true&useSSL=false&characterEncoding=utf-8
    username: root
    password: 123456

MySql 8:
需要添加时区配置

spring:
  datasource:
    driverClassName: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/mp?useUnicode=true&useSSL=false&characterEncoding=utf-8&serverTimezone=GMT%2B8
    username: root
    password: 123456

你可能感兴趣的:(SpringBoot 配置MySql5和8的驱动)