java.sql.SQLException: The server time zone value '' is unrecognized or represents


 

错误信息
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.

错误信息翻译
java.sql.SQLException:

服务器时区值'???ú±ê×??±??'是未被认可的,或表示多个时区。

如果你想要使用时区支持,你必须配置服务器或JDBC驱动(通过服务器Timezone配置属性)来使用更为特定的时区值。

错误处理
url中添加serverTimezone=GMT

<property name="DB.URL" value="jdbc:mysql://${DB.HOST}:${DB.PORT}/${DB.SID}?allowMultiQueries=true&amp;useSSL=false"/>
<property name="DB.URL" value="jdbc:mysql://${DB.HOST}:${DB.PORT}/${DB.SID}?allowMultiQueries=true&amp;useSSL=false&amp;useSSL=false&amp;serverTimezone=GMT"/>
note:第一个配置为报错的url,第二个为修正后的url。

note:由于是xml配置,所以使用&amp;表示&,如果url配置文件不为xml,可以直接使用&。

原文地址:https://www.cnblogs.com/YuyuanNo1/p/12576561.html