当出现Caused by: java.sql.SQLException: Unknown system variable ‘tx_isolation’
一般是mysql-connector-java的版本太低,数据库的版本太高
之前我用的5.7的数据库,后来换电脑了 装了8.0的数据库,然后mysql-connector-java
之后换把mysql-connector-java的版本调高了
需要注意的是
中间又出了这样的错误
Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver‘. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
需要把com.mysql.jdbc.Driver换成com.mysql.cj.jdbc.Driver
jdbc:mysql://localhost:3306/addict?characterEncoding=utf-8&serverTimezone=GMT
原文地址:https://www.cnblogs.com/ccgyyn/p/10489177.html
时间: 2024-10-07 23:32:09