티스토리 뷰

반응형

The server time zone value is unrecongnized or represents more than one time zone

아래 문장처럼 The server time zone value 경고문이 나올 때 해결방법


###Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The server time zone value '' is unreconized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specific time zone valu if you want to utilize time zone support.)] with root cause

com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time value '' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

증상

Spring JDBC를 MySql과 연결하려고 했을 때 에러가 생김.

에러 메시지를 보면 계속 time zone을 맞춰달라고 한다.

원인

MySql의 버전이 높을 경우 TimeZone과 SSL을 체크해줘야 하는데 안해줘서 생기는 오류

해결

dataSourc()로 가서

driver.Class.Name = "com.mysql.cj.jdbc.Driver
url = &verifyServerCertificate=false&useSSL=false&serverTimezone=UTC 를 추가해준다.

반응형
댓글
반응형
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
글 보관함