[英]java.sql.SQLException: Unknown system variable 'transaction_isolation'
I manually changed the version of mysql from 5.6.51 to 8.0.28, Then I used my java program to connect mysql and got the following error我手动把mysql的版本从5.6.51改成8.0.28,然后用我的java程序连接mysql出现如下错误
java.sql.SQLException: Unknown system variable 'transaction_isolation'
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:829)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:449)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:242)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
Below is my mysql Connector/J version下面是我的 mysql Connector/J 版本
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.28</version>
</dependency>
I may have found the reason, the reason is that I only modified the version number on the surface, but in fact java calls 'transaction_isolation' of mysql v8 according to the version information, and my mysql is actually only v5, missing 'transaction_isolation'我可能已经找到原因了,原因是我表面上只修改了版本号,但实际上java根据版本信息调用了mysql v8的'transaction_isolation',而我的mysql实际上只有v5,缺少'transaction_isolation'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.