shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

sharding_proxy: Caused by: java.sql.SQLException: Unknown system variable 'query_cache_size'

Open msnetc opened this issue 7 years ago • 5 comments

Bug Report

use sharding-proxy-3.1.0 connect to mysql 5.7 with config config-sharding.yaml。 sharding-proxy-3.1.0 ‘s error log:

Caused by: java.sql.SQLException: Unknown system variable 'query_cache_size' at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2444) at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1381) at com.mysql.jdbc.ConnectionImpl.loadServerVariables(ConnectionImpl.java:3766) at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3229) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2238) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2024) at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:779) at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)

msnetc avatar Mar 27 '19 02:03 msnetc

what is version of your jdbc driver? upgrade your jdbc driver and try it again

codefairy08 avatar Mar 27 '19 02:03 codefairy08

what is version of your jdbc driver? upgrade your jdbc driver and try it again

I have updated my jdbc drvier to mysql-connector-java-8.0.15 on the host of sharding_proxy, mysql server is on the other server。 but it still hava the error of Caused by: java.sql.SQLException: Unknown system variable 'query_cache_size'。

warning: mysql-connector-java-8.0.15-1.el7.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY package mysql-connector-java-8.0.15-1.el7.noarch is already installed

msnetc avatar Mar 27 '19 02:03 msnetc

Hi @msnetc, I'm sorry, could you please describe as detailed as you can? Before your respond. Let me guess what the problem is. You JDBC(cliend)'s version is too low to match MySQL server 5.7.

BTW, why and how you update JDBC on sharding-proxy host?

tuohai666 avatar Mar 28 '19 03:03 tuohai666

@tuohai666 ,maybe I use the wrong version of config file, so I close the config.

msnetc avatar Mar 30 '19 03:03 msnetc

Here is a blog http://www.tusacentral.net/joomla/index.php/mysql-blogs/198-proxysql-server-version-impersonation.html It explains why the issue happens

lihao5257 avatar May 30 '19 14:05 lihao5257