masber
masber

Reputation: 3067

issues with mysql server timezone and jdbc connection

I am getting this error when connecting to my database.

com.mysql.cj.core.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near '=Australia/Sydney;useSSL=false;'.

this is my connection string:

jdbc:mysql://localhost:3306/mydb?useLegacyDatetimeCode=false;serverTimezone=Australia/Sydney;useSSL=false;

My environment:

Any idea what is wrong?

thank you very much

Upvotes: 1

Views: 8087

Answers (1)

user1529891
user1529891

Reputation:

Don't use ;, try: jdbc:mysql://localhost:3306/mydb?useLegacyDatetimeCode=false&serverTimezone=Australia/Sydney&useSSL=false

See https://dev.mysql.com/doc/connector-j/6.0/en/connector-j-reference-jdbc-url-format.html

Upvotes: 8

Related Questions