Skip to content

Commit 31dff13

Browse files
committed
Server:解决 Windows 上 MySQL 7 及以下版本报错 The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone
1 parent 0857fac commit 31dff13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/demo/server/DemoSQLExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public PreparedStatement getStatement(@NotNull SQLConfig config) throws Exceptio
122122
+ config.getDBAccount() + "&password=" + config.getDBPassword());
123123
}
124124
else {
125-
connection = DriverManager.getConnection(config.getDBUri() + "?useUnicode=true&characterEncoding=UTF-8&user="
125+
connection = DriverManager.getConnection(config.getDBUri() + "?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8&user="
126126
+ config.getDBAccount() + "&password=" + config.getDBPassword());
127127
}
128128
}

0 commit comments

Comments
 (0)