作者:切尔小妹_288 | 来源:互联网 | 2023-07-31 16:05
SpringBoot连接MySQL
1. MySQL 8
yaml配置:
spring:
datasource:
username: root
password: root
url: jdbc:mysql://localhost:3306/mybatis_plus?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezOne=UTC
driver-class-name: com.mysql.cj.jdbc.Driver
2. MySQL 5
yaml配置:
spring:
datasource:
username: root
password: root
url: jdbc:mysql://localhost:3306/mybatis_plus?useSSL=false&useUnicode=true&characterEncoding=utf-8
driver-class-name: com.mysql.jdbc.Driver