Skip to content

Instantly share code, notes, and snippets.

@dolt131943
Created December 2, 2017 02:11
Show Gist options
  • Save dolt131943/6a785240e38ca75ee3252baba5c97d86 to your computer and use it in GitHub Desktop.
Save dolt131943/6a785240e38ca75ee3252baba5c97d86 to your computer and use it in GitHub Desktop.
Windwos Mysql 5.7.x Timezone error when connect with JDBC

Env: Windows 10 Mysql 5.7.x Jdk1.8.x Mysql Connector Java 6.0.5

ERROR:

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

修正方法:

方法1: 在服务端设置服务器全局的时区 方法2: 在JDBC连接串中添加时区设置参数 方法3: 待定, https://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html#time-zone-installation

参考资料:

  1. https://stackoverflow.com/questions/4562456/mysql-setting-time-zone-in-my-cnf-options-file
  2. https://stackoverflow.com/questions/26515700/mysql-jdbc-driver-5-1-33-time-zone-issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment