文章目录
- 1. Spring Boot 2 初始化数据库脚本 data.sql & user.sql
- 2. 文件放置的位置 如下表:
- 3. application.yml 配置写法
1. Spring Boot 2 初始化数据库脚本 data.sql & user.sql
user.sql :数据表结构
data.sql :数据内容
2. 文件放置的位置 如下表:
3. application.yml 配置写法
pring:datasource:driver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://localhost:3306/db?serverTimezone=GMT%2B8username: rootpassword: root
# 自动加生成表格和加载数据
# schema-username: root
# schema-password: root
# data-username: root
# data-password: rootplatform: mysqlschema: classpath:sql/*.sqldata: classpath:sql/data/*.sqlcontinue-on-error: trueinitialization-mode: always