美文网首页学习中问题记录
mysql新驱动引发的异常

mysql新驱动引发的异常

作者: 乌托邦缤果 | 来源:发表于2017-05-02 14:51 被阅读0次

org.activiti.engine.ActivitiException: couldn't check if tables are already present using metadata:

### Error getting a new connection. 

Cause: 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

mysql使用mysql-connector-java 6.0.3/6.0.4 运行程序报异常

The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.

原因:

数据库和系统时区差异造成

解决办法:

在jdbc连接的url后面加上serverTimezone=GMT或者UTC参数即可。

eg:

<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
"/>

相关文章

网友评论

    本文标题:mysql新驱动引发的异常

    本文链接:https://www.haomeiwen.com/subject/sgbctxtx.html