mysql 服务器时区和 jdbc 连接问题
issues with mysql server timezone and jdbc connection
我在连接到我的数据库时遇到此错误。
com.mysql.cj.core.exceptions.WrongArgumentException: Malformed
database URL, failed to parse the connection string near
'=Australia/Sydney;useSSL=false;'.
这是我的连接字符串:
jdbc:mysql://localhost:3306/mydb?useLegacyDatetimeCode=false;serverTimezone=Australia/Sydney;useSSL=false;
我的环境:
- java 8
- mysql-连接器-java:6.0.6
- Mysql 服务器 community:5.7.18
知道哪里出了问题吗?
非常感谢
不要使用;
,试试:jdbc:mysql://localhost:3306/mydb?useLegacyDatetimeCode=false&serverTimezone=Australia/Sydney&useSSL=false
见https://dev.mysql.com/doc/connector-j/6.0/en/connector-j-reference-jdbc-url-format.html
我在连接到我的数据库时遇到此错误。
com.mysql.cj.core.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near '=Australia/Sydney;useSSL=false;'.
这是我的连接字符串:
jdbc:mysql://localhost:3306/mydb?useLegacyDatetimeCode=false;serverTimezone=Australia/Sydney;useSSL=false;
我的环境:
- java 8
- mysql-连接器-java:6.0.6
- Mysql 服务器 community:5.7.18
知道哪里出了问题吗?
非常感谢
不要使用;
,试试:jdbc:mysql://localhost:3306/mydb?useLegacyDatetimeCode=false&serverTimezone=Australia/Sydney&useSSL=false
见https://dev.mysql.com/doc/connector-j/6.0/en/connector-j-reference-jdbc-url-format.html