JAVA

The server time zone Error

seoca 2019. 7. 31. 08:26

 

 

Error

The server time zone value 'EDT' 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 specific time zone value if you want to utilize time zone support.

 

 

 

Start MySQL 

mysql -u root -p

 

 

 

Change directory to search my.cnf

cd /usr/local/etc/my.cnf

 

 

 

Check "my.cnf" File

cat my.cnf

 

 

 

add  default-time-zone = '+08:00' at the end of the 'my.cnf' file

nano my.cnf

 

 

 

And add serverTimezone=UTC in the JDBC connection string

 

 

 

 

 

Reference

https://whitepaek.tistory.com/20

https://www.mkyong.com/jdbc/java-sql-sqlexception-the-server-time-zone-value-xx-time-is-unrecognized/