Java connection MySQL 8.0.11 error
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 Com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException (sqlexceptionsmapping.java:115)
At Com.mysql.cj.jdbc.ConnectionImpl.execSQL (connectionimpl.java:1983)
At Com.mysql.cj.jdbc.ConnectionImpl.execSQL (connectionimpl.java:1936)
At Com.mysql.cj.jdbc.StatementImpl.executeQuery (statementimpl.java:1422)
At Com.mysql.cj.jdbc.ConnectionImpl.loadServerVariables (connectionimpl.java:2831)
At Com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer (connectionimpl.java:2381)
At Com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly (connectionimpl.java:1739)
At Com.mysql.cj.jdbc.ConnectionImpl.createNewIO (connectionimpl.java:1596)
At Com.mysql.cj.jdbc.connectionimpl.<init> (connectionimpl.java:633)
At Com.mysql.cj.jdbc.ConnectionImpl.getInstance (connectionimpl.java:347)
At Com.mysql.cj.jdbc.NonRegisteringDriver.connect (nonregisteringdriver.java:219)
At Java.sql.DriverManager.getConnection (drivermanager.java:664)
At Java.sql.DriverManager.getConnection (drivermanager.java:270)
The reason is Mysql-connector-java version or 6.0.6, need to upgrade version to 8.0.11, this error does not exist
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>
MySQL 8.0 Java connection error: Unknown system variable ' query_cache_size '