ERROR-java.sql.SQLException: The server time zone 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 ..

CODEDRAGON Development/Java

반응형

 

 

오류메시지

java.sql.SQLException: The server time zone 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.

java.sql.SQLException: The server time zone 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.

at

 

 

 

 

 

해결방법

MySQL 타임존의 시간표현 포맷이 달라 connector에서 인식을 하지 해서 발생합니다.

데이터베이스 경로 뒤에 ? 아래의 문자열을 추가해 줍니다.

Connection con = DriverManager.getConnection(

"jdbc:mysql://localhost/datadb?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC",

"root", "mysqlpw");

 

Connection con = DriverManager.getConnection(

"jdbc:mysql://localhost/datadb?serverTimezone=UTC",

"root", "mysqlpw");