Skip to content

Instantly share code, notes, and snippets.

@Sharabaddin
Last active November 7, 2021 17:36
Show Gist options
  • Save Sharabaddin/9d3ba65785e89624068cc99877a7f2c5 to your computer and use it in GitHub Desktop.
Save Sharabaddin/9d3ba65785e89624068cc99877a7f2c5 to your computer and use it in GitHub Desktop.
java.sql.SQLException: The server time zone value 'EEST' is unrecognized or represents more than one time zone
ERROR: java.sql.SQLException: The server time zone value 'EEST' 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.
SOLVE:
1. sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
2. add after line [mysqld]
default_time_zone='+03:00'
3. ctrl+o
4. ctrl+x
5. sudo service mysql restart
@GCastilho
Copy link

Does this work with summer/winter times?

@dorianm
Copy link

dorianm commented May 22, 2018

@GCastilho : I'm afraid it doesn't work.

I have the same issue with MariaDB (10.2) on Debian 9. I'm in France (+02:00 in summer, +01:00 in winter), so I try with the parameters

default_time_zone='+02:00'

It works but it won't be automatically changed so I'm looking for another solution.

@dorianm
Copy link

dorianm commented May 22, 2018

GCastilho : Better solution here (https://stackoverflow.com/a/39703002/1369579)

Step 1 : populate MySQL schema with timezones

On server:

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

Step 2 : change default timezone

On my.cnf :

# Timezone
default_time_zone=Europe/Paris

Step 3 : restart server

sudo systemctl restart mariadb

It works well for me. Hope it helps.

@juanii000
Copy link

asdasdasf

@emrosales
Copy link

How about Mexico and procedure for windows???

@dwityaPrawira
Copy link

Thank you.. work for me. (linux mint)

@ihsonnet
Copy link

I've Solved this problem by using this in my application.properties

spring.datasource.url=jdbc:mysql://localhost:3306/plasmin?serverTimezone=Australia/Sydney

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment