Spring Boot 配置 MySQL 数据库
一、导入 Maven 依赖
<!--MySQL jdbc 驱动-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.17</version>
</dependency>二、在 application.yml 中配置数据源
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/csvswitch?serverTimezone=GMT%2B8&characterEncoding=utf8&useSSL=true
username: root
password: password # 你的数据库密码 最后更新于