Skip to content

Commit 545a5ce

Browse files
juzi214032colorful3
authored andcommitted
fix: 为数据源账号密码配置添加双引号
防止数据库密码出现特殊字符与 yaml 不兼容 close #91
1 parent 6306d3b commit 545a5ce

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/main/resources/application-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ server:
88
spring:
99
# 数据源配置,请修改为你项目的实际配置
1010
datasource:
11+
username: "root"
12+
password: "123456"
1113
driver-class-name: com.mysql.cj.jdbc.Driver
12-
password: 123456
1314
url: jdbc:mysql://localhost:3306/lin-cms?useSSL=false&serverTimezone=UTC&characterEncoding=UTF8
14-
username: root
1515

1616

1717
# 开启权限拦截

src/main/resources/application-prod.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ server:
77
spring:
88
# 数据源配置,请修改为你项目的实际配置
99
datasource:
10+
username: "root"
11+
password: "123456"
1012
driver-class-name: com.mysql.cj.jdbc.Driver
11-
password: 123456
1213
url: jdbc:mysql://localhost:3306/lin-cms?useSSL=false&serverTimezone=UTC&characterEncoding=UTF8
13-
username: root
1414

1515
# 开启权限拦截
1616
auth:

src/main/resources/application-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ logging:
1212
spring:
1313
# h2 内存数据库配置,供测试使用,其它环境勿用
1414
datasource:
15-
continue-on-error: false
16-
driver-class-name: org.h2.Driver
15+
username: "sa"
1716
password: ''
1817
platform: h2
18+
continue-on-error: false
1919
schema: classpath:/h2-test.sql
20+
driver-class-name: org.h2.Driver
2021
url: jdbc:h2:mem:testdbsa;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false
21-
username: sa
2222
h2:
2323
console:
2424
enabled: true

0 commit comments

Comments
 (0)