`

The server time zone value 'xxx' is unrecognized or represents more than one tim

 
阅读更多

The server time zone value 'xxx' is unrecognized or represents more than one time zone 问题的解决方法

在使用数据库连接池的情况下,最好设置如下两个参数:
autoReconnect=true&failOverReadOnly=false


参考:https://www.oschina.net/question/16_2400

     http://java12345678.iteye.com/blog/2265639

     http://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html


mysql bug网址:
http://bugs.mysql.com/bug.php?id=75440


Tomcat中的jdbc连接池
Tomcat 不仅是非常受欢迎的 Servlet 容器,也是同时为我们提供了很多非常实用组件。 jdbc pool 就是其中一个非常实用且高效的 jdbc 连接池的实现.
Tomcat 官方大概列出了15条tomcat相对于其他连接池的优点:
http://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html#Additional_features'

jdbc pool 组件存在于 tomcat8 release 版本的 lib/tomcat-jdbc.jar 包中。


我们所使用的到所有类都存在于 org.apache.tomcat.jdbc.pool 包名下。

依赖

这里面我们以 mysql 作为数据库来演示
添加 mysql-connector 依赖

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

当然也少不了我们的 tomcat-jdbc
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-jdbc</artifactId>
    <version>8.0.15</version>
</dependency>


要注意的是 tomcat-jdbc 依赖 tomcat-juli 包,这个包是在tomcat中的日志框架。几乎被所有tomcat包所依赖。如果使用maven安装依赖的话,就不用理会,因为是会被自动安装的,如果单独下载jar包的话,还是要下载这个jar包到CLASS_PATH

https://segmentfault.com/a/1190000002504983

它的英文文档在http://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html
分享到:
评论

相关推荐

    mysql优化总结

    MySQL优化总结 MySQL 数据库优化是至关重要的,因为数据库的性能直接影响到程序的性能。为保证数据库的效率,需要做好四个方面的工作:数据库设计、SQL 语句优化、数据库参数配置和恰当的硬件资源和操作系统。...

    菁菁整站 v3.1 繁体正式版

    "菁菁整站 v3.1 繁体正式版"是一个专为用户提供全面网站解决方案的软件产品。这个版本是繁体语言的正式发行版,意味着它已经经过了严格的测试和优化,适合大规模的商业应用或者专业级别的网站构建。...

    超高频开发包xy-new.part06.rar

    超高频开发包xy-new.part06.rar

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

    ’ is unrecognized or represents more than one time zone”。这个错误表明服务器时区的值无法识别或者它代表了多个时区,这通常是由于数据库服务器与JDBC驱动之间的时间区域设置不匹配所导致的。 首先,我们需要...

    mysql时区异常.docx

    MySQL时区异常通常出现在数据库与应用程序之间的时间处理不一致时,这种问题可能引发...此外,理解并正确设置`serverTimezone`属性对于确保日期和时间的正确同步至关重要,特别是当你的应用涉及跨时区的用户或操作时。

    解决IDEA错误 Cause: java.sql.SQLException: The server time zone value的问题

    标题中的问题“Cause: java.sql.SQLException: The server time zone value”是Java开发者在使用IDEA(IntelliJ IDEA)进行数据库连接时常见的错误提示。这个错误通常发生在尝试连接到MySQL等SQL数据库时,由于...

    mysql-connector-java-8.0.11.jar

    ' 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 ...

    mysql-driver 5.1.45.zip

    新版的mysqljdbc驱动jar包的配置与之前... Cause: java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the

    成功解决stata软件中 command pwcorr-a is unrecognized问题

    成功解决stata软件中 command pwcorr_a is unrecognized问题。 步骤,把文件中.ado文件放在路径..\Stata\base\p中。 已经成功解决。

    mysql6.0连接中的几个问题mysql6.xx.docx

    ' is unrecognized or represents more than one time zone.`的错误时,这是由于服务器时间区域值未被正确识别或者表示多个时区。解决方法是在JDBC URL后面添加`serverTimezone`参数,将其值设置为`UTC`或其他特定...

    服务器时区错误1

    首先,当服务器报错 "The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone" 时,这意味着MySQL服务器无法识别或解析当前设定的时间区域值。这种现象通常由于...

    Jmeter连接Mysql数据库实现过程详解

    我们可能会出现一个报错:java.sql.SQLException: Cannot create PoolableConnectionFactory (The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone....

    Spring boot连接MySQL 8.0可能出现的问题

    在使用 JDBC 连接 MySQL 时,可能会出现“The server time zone value '�й����ʱ��' is unrecognized or represents more than one time zone.”错误。这是 MyBatis 时区错误,可以在链接库的 URL 中加 ...

    Jmeter JDBC请求常见问题解决方案

    ' 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 specific time zone value if ...

    2009 达内Unix学习笔记

    ls -t (time)按修改时间排序,显示目录和文件。 ls -lt 是“-l”和“-t”的组合,按时间顺序显示列表。 ls -F 显示文件类型,目录“/ ”结尾;可执行文件“*”结尾;文本文件(none),没有结尾。 ls -R 递归显示...

    springboot整合mybatis中的问题及出现的一些问题小结

    2. The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone解决方案 在使用MyBatis时,可能会遇到服务器时区值无法识别的问题。解决方案是,在application...

    PyCharm MySQL可视化Database配置过程图解

    ’ is unrecognized or represents more than one time zone.”。为解决这个问题,您需要在连接属性(Properties)中设置“serverTimezone”参数,通常设置为“UTC”。注意大小写敏感。 7. 设置完毕后,点击“Test ...

    MATLAB串口调试界面程序

    % unrecognized property name or invalid value makes property application % stop. All inputs are passed to uart_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows ...

    TRegware 4.02

    - If the registry data is corrupted or unrecognized TRegware sets itself unregistered Version 3.20: - A set of compiler-time options are now available in the unit reg_opts.pas It is suggested to ...

Global site tag (gtag.js) - Google Analytics