当前位置:首页 > The server time zone value '' is unrecognized or represents more than one ti

The server time zone value '' is unrecognized or represents more than one ti

点击次数:3555  更新日期:2018-07-28

使用hibernate保存数据到mysql时,报错"The server time zone value 'xxxxxxx' is unrecognized or represents more than one time zone.


<property name="hibernate.connection.url">jdbc:mysql:///test3?characterEncoding=utf8&amp;serverTimezone=GMT</property>


这是由于数据库和系统时区差异所造成的,解决方式是在数据库url地址后面加上serverTimezone=GMT