com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���׼

原创 2017年05月04日 18:00:11
com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: 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.
	sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)
	com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)
	com.mysql.cj.jdbc.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:118)
	com.mysql.cj.mysqla.MysqlaSession.configureTimezone(MysqlaSession.java:308)
	com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:2474)
	com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:1817)
	com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1673)
	com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:656)
	com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:349)
	com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:221)
	org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
	org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
	org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
	org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
	org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
	org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
	org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
	org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:225)
	com.sun.proxy.$Proxy17.getMetaData(Unknown Source)
	org.activiti.engine.impl.db.DbSqlSession.isTablePresent(DbSqlSession.java:1113)
	org.activiti.engine.impl.db.DbSqlSession.isEngineTablePresent(DbSqlSession.java:1094)
	org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpdate(DbSqlSession.java:1027)
	org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:1422)
	org.activiti.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:27)
	org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
	org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
	org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
	org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
	org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
	org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
	org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
	org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:80)
	org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:613)
	org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:65)
	org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:60)
	org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32)
	org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
	org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
	org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1634)
	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:254)
	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:372)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
	org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
	org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
	org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
	org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
	org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:138)
	javax.servlet.GenericServlet.init(GenericServlet.java:158)
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
	org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
	org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	java.lang.Thread.run(Thread.java:745)

使用的是

<dependency>        	
	<groupId>mysql</groupId>        	
	<artifactId>mysql-connector-java</artifactId>        	
	<version>6.0.6</version>        
</dependency>

替换成:

<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
	<version>5.1.42</version>
</dependency>

版权声明:本文为博主原创文章,未经博主允许不得转载。

jsp连接mysql数据库报时区错误

jsp链接mysql数据库的代码
  • sinat_33201781
  • sinat_33201781
  • 2016年07月05日 13:14
  • 4981

com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���׼

解决方案: 为URL添加参数:jdbc:mysql://localhost:3306/sys?useUnicode=true&characterEncoding=UTF-8&useJDBCCompl...
  • qq_16166139
  • qq_16166139
  • 2016年10月17日 13:30
  • 3800

Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone...

spring boot + mybaits 出现异常:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache...
  • mjlfto
  • mjlfto
  • 2017年07月09日 21:22
  • 600

mysql The server time zone value 异常

测试时报The server time zone value '这部分内容是乱码' is unrecognized or represents more than one time zone 为...
  • zhanghai005243
  • zhanghai005243
  • 2016年08月02日 10:35
  • 5130

异常:java.sql.SQLException: The server time zone value '?й???????' is unrecognized or represents more

软件开发,为了满足开发的需要,jar包版本的更新或bug的修复,会造成 版本不兼容,出现新问题,程序员就是为解决问题出现的,一句话就是我们爱折腾,乐此不彼。 异常错误:java.sql.SQLExce...
  • anaini1314
  • anaini1314
  • 2017年05月04日 09:01
  • 930

The server time zone value '?泄???????' is unrecognized or represents more t

原创博主的地址:http://blog.csdn.net/oppo5630/article/details/52162783解决org.springframework.beans.factory.Be...
  • kevinWang2016
  • kevinWang2016
  • 2017年04月01日 12:35
  • 3109

连接数据库:ERROR: The server time zone value '�й�׼' is unrecognized or represents more than one time zone

提示系统时区出现错误,可以在mysql中执行命令: set global time_zone='+8:00' 或者在数据库驱动的url后加上serverTimezone=UTC参数写代码的时候要注...
  • dongsl161
  • dongsl161
  • 2017年02月22日 19:52
  • 3183

解决mysql java.sql.SQLException: The server time zone value‘XXXXXX' is unrecognized or represents...

个人错误总结解决java.sql.SQLException: The server time zone value ‘XXXXXX’ is unrecognized or represents mor...
  • oppo5630
  • oppo5630
  • 2016年08月09日 14:58
  • 6695

MySQL5.7 The server time zone value 异常处理

com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���׼...
  • u010725245
  • u010725245
  • 2017年05月05日 13:11
  • 1508

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

在 mysql 中执行命令试下: set global time_zone=’+8:00’ 设置为东8区就不报错了。...
  • sunlggggg
  • sunlggggg
  • 2017年01月15日 19:25
  • 4329
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���׼
举报原因:
原因补充:

(最多只允许输入30个字)