Administrator
发布于 2018-01-08 / 81 阅读
1

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

mysql的驱动版本号不匹配会报如下问题:
java.sql.SQLException: Unknown system variable 'query_cache_size'

java.sql.SQLException: Unknown system variable 'tx_read_only'

java.sql.SQLException: Unknown system variable 'language'

 解决办法:

 可以到这里https://mvnrepository.com/artifact/mysql/mysql-connector-java查看对应的驱动版本号写上即可,mysql 8.0.3可以用如下驱动:

<!-- MySQL 连接驱动依赖 -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.8-dmr</version>
</dependency>