解决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问题

错误提示:
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is 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.
 
 
解决办法;
 
在连接字符串后面加上?serverTimezone=UTC

其中UTC是统一标准世界时间。

完整的连接字符串示例:jdbc:mysql://localhost:3306/test?serverTimezone=UTC

或者还有另一种选择:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8,这个是解决中文乱码输入问题,当然也可以和上面的一起结合:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC

原文地址:https://www.cnblogs.com/SpaceKiller/p/12297677.html

时间: 2024-08-01 19:32:08

解决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问题的相关文章

错误:“Cannot load JDBC driver class 'com.mysql.jdbc.Driver”的解决方法

"Cannot load JDBC driver class 'com.mysql.jdbc.Driver " 表示没有JDBC连接MySql的驱动包,因此需要手动添加驱动包到WEB-INF目录下的lib目录中. 解决方法: 从网上下载mysql-connector-java.jar,将其放到"D:\workspace\my-web\src\main\webapp\WEB-INF\lib"目录下,即可解决上述问题. 错误:"Cannot load JDBC

How to configure dns slave server in Linux

A DNS server, or name server, is used to resolve an IP address to a hostname or vice versa.You can set up four different types of DNS servers: A master DNS server for your domain(s), which stores authoritative records for your domain. A slave DNS ser

使用Volley来写一个List列表(Valley可以解决很大一部分android请求server的问题)

先上效果图: 先写一个Volley的请求的类: public void fetchData() { String url = "http://2.novelread.sinaapp.com/framework-sae/index.php"; // String body = ""; // try { // mEntity = new StringEntity(body); // } catch (UnsupportedEncodingException e1) {

Configure a syslog server with rsyslog on Ubuntu

A syslog server represents a central log monitoring point on a network, to which all kinds of devices including Linux or Windows servers, routers, switches or any other hosts can send their logs over network. By setting up a syslog server, you can fi

解决Can't connect to MySQL server on 'localhost' (10048)

解决Can't connect to MySQL server on 'localhost' (10048) 您使用的是Windows操作系统,此错误与一个注册表键值TcpTimedWaitDelay有关.减小Windows中TcpTimedWaitDelay时间可解决此类问题,默认情况下为240(未设置的情况下也是这个数值) 此项设置需要到注册表如下位置进行设置HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Paramete

Configure SVN (Subversion) Server

Note: It may need root user permissions to execute following commands. (1) Install needed packages yum install mod_dav_svn subversion In my PC, packages that were installed are Note: if you are going to visit SVN repository via http, you shall have a

JNDI数据源局部配置(解决Cannot create JDBC driver of class '' for connect URL 'null')

最开始,我是借鉴 孤傲苍狼的JNDI教程去做的,他讲得很详细,但是坏处也就是因为他讲的太详细.查了很多书,都是建议说不要用全局去配置JNDI,一是要修改tomcat的server.xml,容易破坏tomcat ,其次是那样吃力不讨好.我是建议用局部变量就好的. 1.步骤一:学习配置JNDI之前,介绍你一定要先掌握tomcat的配置虚拟目录(可以去看Tomcat中主目录配置与虚拟目录配置问题这样的文章,也可以去我的tomcat配置虚拟目录 -思维焦点网易博客找类似的链接).学习了tomcat的配置

解决:The web application [] registered the JDBC driver [] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

问题描述 在将Spring Boot程序打包生成的war包部署到Tomcat后,启动Tomcat时总是报错,但是直接在IDEA中启动Application或者用"java -jar"方式运行jar包时都能正常运行.报错信息如下: To prevent a memory leak, the JDBC Driver has been forcibly unregistered. (为了防止内存泄漏,已强制注销JDBC驱动程序.) 开发环境 Spring Boot + MySql + Spr

MySQL、Oracle、Sql Server数据库JDBC的连接方式

MySQL: 先添加MySQL的jar包 String url="jdbc:mysql://localhost:3306/数据库名";       //数据库地址 String name="root";       //数据库用户名 String password="123456";       //数据库用户密码 Class.forName("com.mysql.jdbc.Driver") ;      //加载MySQL驱