JDBC报错 消息 Could not get JDBC Connection; nested exception is java.sql.SQLException: Unknown system variable 'tx_isolation'

今天用JDBCTemplate时,发现启动服务器之后报错: Could not get JDBC Connection; nested exception is java.sql.SQLException: Unknown system variable ‘tx_isolation‘。

网上说是因为MySQL版本过高的问题,我的MySQL版本是8.0,里面已经没有tx_isolation,变成了transaction_isolation,用了以下几种解决方法:

(1)更改MySQL

 无效,仍然报错!

(2)将mysql-connector-java升级为与MySQL匹配的8.0版本及以上

解决了上一个问题,但是又出现了新的问题:

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

这个错误是因为mysql连接的依赖包是高版本的情况下,在配置datasource.url时不能简单的这样配:

url=jdbc:mysql://localhost:3306/day13

需要加上一些必要的后缀信息(改成下面的配置就可以了):

url=jdbc:mysql://localhost:3306/day13?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

ok,问题解决!

JDBC报错 消息 Could not get JDBC Connection; nested exception is java.sql.SQLException: Unknown system variable 'tx_isolation'

原文地址:https://www.cnblogs.com/iceywu/p/12188930.html

时间: 2024-11-12 00:39:25

JDBC报错 消息 Could not get JDBC Connection; nested exception is java.sql.SQLException: Unknown system variable 'tx_isolation'的相关文章

Hibernate卡住,然后报错java.sql.SQLException: Unknown system variable 'language'异常

启动应用的时候会卡在: 08:22:58,221 DEBUG IntegratorServiceImpl:46 - Adding Integrator [org.hibernate.cfg.beanvalidation.BeanValidationIntegrator]. 08:22:58,226 DEBUG IntegratorServiceImpl:46 - Adding Integrator [org.hibernate.secure.spi.JaccIntegrator]. 08:22:

Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connectio

严重: StandardWrapper.Throwableorg.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

SpringBoot 上传文件突然报错 Failed to parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.1428942566812653608

异常信息 org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.1428942566812653608.8090/work/Tomcat/localhost/ROOT] is not vali

解决 sqlalchemy 报错:(1193, "Unknown system variable 'tx_isolation'")

1出现此报错的原因是使用的mysql8.0 以前用的是:tx_isolation 现在用是: transaction_isolation a.通过升级 sqlalchemy 的方法可以解决此问题, pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade sqlalchemy --ignore-installed(亲测有效————) b.通过降低,mysql 版本来解决这个问题. 解决 sqlalchemy 报错:(119

java.sql.SQLException: Unknown column 'user0_.user_name' in 'field list' 报错问题

报错信息: java.sql.SQLException: Unknown column 'user0_.user_name' in 'field list'Query is: select user0_.id as id1_0_, user0_.user_name as user_nam2_0_, user0_.password as password3_0_ from user user0_java thread: http-nio-8881-exec-1 Hibernate报错:说表里没有u

mysql 8.0 java连接报错:Unknown system variable 'query_cache_size'

java连接mysql 8.0.11报错 java.sql.SQLException: Unknown system variable 'query_cache_size' at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:545) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513) at co

JDBC 报错 "SQLException: Column 'addtime' not found",求助!

<select id="listComntedProdId" resultType="java.util.Map"> select op.*, oc.comment, oc.score + 0 as score, oc.sid, oc.images, oc.is_show + 0 as is_show, oc.addtime  as comment_addtime from onlineshop_comment as oc inner join onli

Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException:

七月 17, 2014 4:56:01 下午 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [dispatcher] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemExc

JDBC 报错 CommunicationsException: Communications link failure

|--报错内容 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at com.mysql.cj.jdbc.exceptions