编程知识 cdmana.com

The server time zone value "is unrecogni" appears in JDBC connection database

reason :

Because of the use of Mysql Connector/J 6.x Version above , And then I reported a time zone error

Problems encountered servertime=UTC Lead to time difference 8 Hours (MySQL jdbc 6.0 Version above must be configured with this parameter )


resolvent

  1. primary url
jdbc.url = jdbc:mysql://localhost:3306/ database 
  1. Revised url
jdbc.url = jdbc:mysql://localhost:3306/ database ?serverTimezone=UTC
  1. UTC It's global standard time , But the time we use is the Beijing time zone, which is the eighth East District , leading UTC Eight hours . So use Chinese standard time .
jdbc.url = jdbc:mysql://localhost:3306/ database ?serverTimezone=Asia/Shanghai

Be careful :? Add parameter after , use & Connection configuration multiple parameters

 for example :jdbc.url = jdbc:mysql://localhost:3306/mybatis?serverTimezone=Asia/Shanghai&allowMultiQueries=true

版权声明
本文为[Oc efae96km]所创,转载请带上原文链接,感谢

Scroll to Top