hibernate5.3版本出现hibernate中The server time zone value“乱码”问题的解决办法。

    <!-- 配置关于数据库连接的四个项 driverClass url username password -->
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/hiber01?serverTimezone=GMT</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.connection.password">123456</property>

参考别人的博客,原因是:数据库和系统时区的差异。

在jdbc的url后面加

serverTimezone=GMT
就解决了我的问题。

由于新安装的mysql,第一次连接出现了access denied for user 'root'@'localhost'(using password:YES)问题。

没有大毛病就是密码写错了。jdbc连接的密码换上我安装mysql时设定的正确密码就行了。



posted @ 2019-05-21 11:42  永远没对象  阅读(181)  评论(0编辑  收藏  举报