1
votes

For some reason I am getting this error while trying to start my java app.

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

I would like to be able to change the timezone on the connection string. So far I tried this:

javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/returnit?useLegacyDatetimeCode=false&serverTimezone=UTC"

and this:

javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/returnit?useLegacyDatetimeCode=false&serverTimezone=Australia/Sydney"

But for some reason mysql is not picking up the timezone and still complains about AEDT?

Mysql connector version is 6.0.6 System I am running in MacOS Mysql version is

QUESTION: Any idea about how to setup serverTimezone through connection string?

thank you very much

1
There is a similar question asked here : stackoverflow.com/questions/930900/…sudip
@sudip yes I want to set the timezone throught the connection string. A potential solution from your link but didn't workmasber
You want to set the serverTimezone property in mysql server instead of passing timezone as part of connectionString, right? Is the solution stackoverflow.com/a/19069310/452213 not working for you?sudip
@sudip I want to tell mysql the timezone in the connection string. I preffer not to do that in the database configurationmasber
AEDT is not a time zone id. I'm guessing you want to pass Australia/Sydney instead. See this list.Matt Johnson-Pint

1 Answers

3
votes

this is an example of a connection string specifying serverTimezone:

"jdbc:mysql://localhost:3306/returnit?useSSL=false&useUnicode=true&serverTimezone=UTC"