16
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MySQLに接続すると"java.sql.SQLException: The server time zone value"が出る

Posted at

環境

MySQL:5.7.21
Spring-boot:2.1.0
MyBatis spring-boot-stater:1.3.2
MySQLドライバ:mysql-connector-java-8.0.13

解決

DDBC接続のURLに serverTimezone パラメータを付ける。

spring.datasource.url=jdbc:mysql://localhost:3306/test

spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=JST

備考

古い組み合わせ↓だとパラメータ無しでも普通に動くけど、例外出るようになったのは謎。(まー、どっか変わったんでしょうけど。。
MySQL:5.7.21
Spring-boot:2.0.5
MyBatis spring-boot-stater:1.3.2
MySQLドライバ:mysql-connector-java-5.1.47

16
14
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?