WEB项目运行时,多次遇到 The server time zone value 'Öйú±ê×¼Ê

Posted 马永东

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WEB项目运行时,多次遇到 The server time zone value 'Öйú±ê×¼Ê相关的知识,希望对你有一定的参考价值。

最近很多次遇到 The server time zone value \'Öйú±ê׼ʱ¼ä\' is unrecognized or represents more than one time zone这个问题,

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.
    com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127) com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95) com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:87) com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:61) com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:71) com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76) com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:862) com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:444) com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:230) com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:226) com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203) com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)

......

后面的错误我就不列举出来了哈,

查阅了网上的资料,发现解决方法好多,但是这个其实是数据库中时间设置的问题

解决办法如下:

(1)首先我打开数据库终端后,输入 show variables like \'%time_zone%\';

(2)再进行时区设置,使用指令: set global time_zone=\'+8:00\';

(3)再次运行自己的项目,你会发现这个问题解决了

 

最后也特别感谢链接:https://blog.csdn.net/weixin_39033443/article/details/81711306提供的思路

以上是关于WEB项目运行时,多次遇到 The server time zone value 'Öйú±ê×¼Ê的主要内容,如果未能解决你的问题,请参考以下文章

我在用myeclipse运行一个web程序是报错:there are no configured servers that support the application

通过 VSCode 运行 Flutter 项目时找不到名为“web-server-debug-protocol”的选项

The server's host key is not cached in the registry. You have no guarantee that the server……(示例

eclipse部署Tomcat6 : The server does not support version 3.0 of the JEE Web module specification

配置tomcat时遇到publishes and runs j2ee and java ee web projects and server configurations to a local tom

解决搭建官方openstack时遇到的服务器报错Internal Server Error 返回状态500The server encountered an internal error