解决问题:java.sql.SQLException: Unknown system variable 'tx_isolation'

是因为MySQL版本高但驱动jar包的版本太低, 因此将mysql-connector-java升级到最新版本就解决了问题:


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

但紧接着又发现报错:

在数据库连接配置文件中修改url,在url后面增加:

&serverTimezone=UTC


又报错如下:

端口被占用,修改端口号即可启动成功。

解决问题:java.sql.SQLException: Unknown system variable 'tx_isolation'

原文地址:https://www.cnblogs.com/zscwb/p/12530021.html

时间: 2024-08-24 04:42:22

解决问题:java.sql.SQLException: Unknown system variable 'tx_isolation'的相关文章

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

今天用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  无效,仍然

Hibernate卡住,然后报错java.sql.SQLException: Unknown system variable &#39;language&#39;异常

启动应用的时候会卡在: 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:

java.sql.SQLException: Unknown system variable &#39;query_cache_size&#39;

Jar包版本不对: <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.40</version> </dependency> 换个版本就好了: <dependency> <groupId>mysql</groupId> <arti

java.sql.SQLException: Unknown type &#39;246 in column 0 of 1 in binary-encoded result set的解决办法

最近在大学毕设项目基础上新增一些功能,基于Struts2开源框架,数据库采用的是MySQL.写完后台的新功能代码,单元测试也顺利通过,去整合前台,但是当使用JSP页面操作的时候,没想到报异常了.截图如下: java.sql.SQLException: Unknown type '246 in column 2 of 4 in binary-encoded result set. 纳闷了,为什么能够通过JUnit呢? 几经查找,都说是MySQL的bug,更换了MySQL新版本的驱动包,比如mysq

解决 sqlalchemy 报错:(1193, &quot;Unknown system variable &#39;tx_isolation&#39;&quot;)

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 &#39;user0_.user_name&#39; in &#39;field list&#39; 报错问题

报错信息: 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

java.sql.SQLException: Unknown initial character set index &#39;255&#39; received from server. Initial client character set can be forced via the &#39;characterEncoding&#39; property.解决方案

解决方案: 首先查看数据库的版本号,删除旧的jar包,将mysql-connector-java.jar更换成对应版本号 同时在连接数据库的url后加上?useUnicode=true&characterEncoding=utf-8 java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via

mysql 8.0 java连接报错:Unknown system variable &#39;query_cache_size&#39;

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

Unknown system variable &#39;query_cache_size&#39; 错误原因以及解决办法

Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown system variable