티스토리 뷰

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/

'JAVA' 카테고리의 다른 글

Read CSV File and store data to MySQL  (0) 2019.08.01
Access ArrayList from another class  (0) 2019.08.01
Connect to MySQL using Java JDBC  (0) 2019.07.31
Java is Pass-By-Value  (0) 2019.07.27
Arrays.sort in Java  (0) 2019.07.23