[Spring Webflux][R2DBC] The server timezone is <????> that's unknown, trying to use system default timezone 조지기
Version 정보
org.springframework.boot 3.4.2
org.jetbrains.kotlin.jvm 1.9.25
org.jetbrains.kotlin.plugin.spring 1.9.25
implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
implementation("dev.miku:r2dbc-mysql:0.8.2.RELEASE")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
문제점
에러 로그
The server timezone is <???ѹα? ǥ?ؽ> that's unknown, trying to use system default timezone
ChatGPT에게 도움을 구하면 헛소리만 함.
개인적인 생각으로 dev.miku:r2dbc-mysql의 유지보수가 20년도가 마지막이라, 패키지 자체에 문제가 있을 것이라 생각함.
대안으로, io.asyncer:r2dbc-mysql을 사용하는 방법이 있음. 최근까지 유지보수가 되고, 심적으로 안정됨.
링크: https://github.com/asyncer-io/r2dbc-mysql
아래 버전을 참고해서 사용하면 됨.
spring boot | io.asyncer:r2dbc-mysql |
3.0.* and above | io.asyncer:r2dbc-mysql:1.4.0 |
2.7.* | io.asyncer:r2dbc-mysql:0.9.7 |
2.6.* and below | io.asyncer:r2dbc-mysql:0.8.2 |
다만, 사내 방화벽으로 인해 io.asyncer:r2dbc-mysql의 사용이 어려웠고
dev.miku:r2dbc-mysql에서 발생하는 문제를 해결함.
해결책
serverZoneId를 입력하여 해당 문제를 해결할 수 있음.
spring:
main:
web-application-type: reactive
application:
name: test_app
r2dbc:
url: r2dbc:mysql://12.23.34.56:1000/?serverZoneId=UTC
username: sga8
password: sga8!