본문 바로가기
Error

The server time zone value '´???¹?±¹ ???ؽ?' is unrecognized or represents more than one time zone

by 지구 2018. 7. 3.

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.

Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: 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.


(에러화면)


원인 : MySQL 서버의 time zone 은 SYSTEM 으로 되어있지만 실제 이클립스에서 접속하려니 한글이 깨지는건지 제대로 타임존을 못가져오는 것 같다.

        찾아보니 mysql-connector-java 버전 5.1.X 이후 버전부터 타임존을 인식하지 못하는 이슈가 있다고 한다.


해결 : https://dev.mysql.com/downloads/timezones.html MySQL 공식홈페이지에 나온대로 timezone_posix.sql 을 다운받아서 덮어도 씌워보고,

         구글링해서 나온대로 set time_zone="Asia/Seoul" 도 해봤는데 다 안먹었다.

         tztimeinfo 관련해서 쓰는 명령어는 현재 실행환경 OS가 Windows 라서 쓸 수 있는게 아니었고 .. 그러다 찾은 방법!

         이클립스에서 getConnection 할 때 주소값 뒤에 " serverTimezone=UTC " 를 써주면 된다.

1
DriverManager.getConnection("jdbc:mysql://192.168.0.47:3306/test?serverTimezone=UTC&useSSL=false""nadri""nadri");
cs



반응형

댓글