Unknown system variable ‘query_ cache_ size’

Time:2021-3-2

Start project idea error:

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

The reason is that the database driver does not correspond to the database version
terms of settlement:

_ For example, mybatis uses the driver of mysql-5.1.14, and the data source configured by mybatis is connected to mysql-8.0.11. Modify the POM file as follows:

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

According to the official statement:

The query cache is deprecated as of MySQL 5.7.20, and is removed in MySQL 8.0. Deprecation includes query_cache_size.

It means that query cache has been out of date since MySQL 5.7.20, but it has been removed since MySQL 8.0.

I’ll just change it to 8.0.11.