Skip to content

Commit 284476b

Browse files
committed
升级druid为1.1.12版本
升级mysql-connector-jar为8.0.14修复不指定版本出现数据库连接错误的BUG 更新spring.datasource.drive-class-name为com.mysql.cj.jdbc.Driver
1 parent 63ea009 commit 284476b

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
<dependency>
155155
<groupId>mysql</groupId>
156156
<artifactId>mysql-connector-java</artifactId>
157+
<version>8.0.14</version>
157158
</dependency>
158159

159160
<dependency>
@@ -175,7 +176,7 @@
175176
<dependency>
176177
<groupId>com.alibaba</groupId>
177178
<artifactId>druid</artifactId>
178-
<version>1.0.11</version>
179+
<version>1.1.12</version>
179180
</dependency>
180181

181182
<dependency>

src/main/resources/application.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ spring:
4949
# 使用druid数据源
5050
datasource:
5151
type : com.alibaba.druid.pool.DruidDataSource
52-
driver-class-name : com.mysql.jdbc.Driver
52+
driver-class-name : com.mysql.cj.jdbc.Driver
53+
dbcp2:
54+
test-while-idle: false
55+
validation-query: SELECT 'x'
5356
#json配置
5457
jackson:
5558
time-zone : Asia/Chongqing
@@ -183,7 +186,7 @@ spring:
183186
name : geekcattle
184187
username : root
185188
password : root
186-
url : jdbc:mysql://localhost:3306/geekcattle?useUnicode=true&characterEncoding=UTF-8
189+
url : jdbc:mysql://localhost:3306/geekcattle?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
187190
redis:
188191
database : 0
189192
host : 127.0.0.1
@@ -203,7 +206,7 @@ spring:
203206
name : geekcattle
204207
username : geekcattle
205208
password : GeekCattle
206-
url : jdbc:mysql://localhost:3306/geekcattle?useUnicode=true&characterEncoding=UTF-8
209+
url : jdbc:mysql://localhost:3306/geekcattle?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
207210
redis:
208211
database : 0
209212
host : 127.0.0.1

src/main/resources/caffeine.properties

-6
This file was deleted.

0 commit comments

Comments
 (0)