当前位置:网站首页>About troubleshooting MySQL driver version errors, cause: com mysql. jdbc. exceptions. jdbc4、Unknown system variable ‘query_ cache_ size
About troubleshooting MySQL driver version errors, cause: com mysql. jdbc. exceptions. jdbc4、Unknown system variable ‘query_ cache_ size
2022-07-22 07:15:00 【Programming stack】
Error01 in the light of Maven Project dependence mysql Driver version mismatch
querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
ERR02 mysql Driver version mismatch
java.sql.Exception in thread “main” java.sql.SQLException: Unknown system variable ‘query_cache_size’
mysql-connecter-java The version of is too low , The database driver does not correspond to the database version
` error 1:
java.sql.Exception in thread "main" java.sql.SQLException: Unknown system variable 'query_cache_size'
` error 2:
java.sql.SQLException: Unknown system variable 'language'
` reason
mysql-connecter-java The version of is too low , The database driver does not correspond to the database version
` solve
1、 Replace the tool kit
mysql-connecter-java-5.1.47.jar Can match mysql8.0+
2、 modify pom file
Such as mybatis Use mysql-5.1.14 Driver program , and mybatis The configured data source is connected to mysql-8.0.11 ,
modify pom file , as follows :
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version> # Change to 8.0+ The version will do .
</dependency>
Officially :
The query cache is deprecated as of MySQL 5.7.20, and is removed in MySQL 8.0. Deprecation includes query_cache_size.
Meaning : Is the query cached in MySQL 5.7.20 Has abandoned , stay MySQL 8.0 Has been removed from . Abandonment includes query_cache_size.
Error03:jdbc Of Aim at mysql8+ Version of URL SSL Verification questions
WARN:hu Apr 15 12:27:34 CST 2021 WARN: Establishing SSL connection Establishing SSL connection without server’s identity verificati
hu Apr 15 12:27:34 CST 2021 WARN: Establishing SSL connection Establishing SSL connection without server's identity verificatio
According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
# solve :
# stay jdbcURL Adding such a line of code to the attribute tag will skip SSL verification
?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
for example :
Connection connect = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/ Database name ?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false","root","root");
EER04:junit-4.11 The above version does not include hamcrest.
java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
junit Unit test error java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
Caused by: java.lang.ClassNotFoundException: org.hamcrest.SelfDescribing
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 19 more
reason
junit-4.11 The above version does not include hamcrest.
resolvent
Method 1 :junit Version down to 4.11 following
Method 2 : Join in hamcrest-core-1.3.jar package
Err05 : The path in the property set configuration file cannot have spaces , Otherwise, the report will be wrong : org.apache.ibatis.exceptions.PersistenceException ,Error building SqlSession.
org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in configstatic/UserMapper.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'configstatic/UserMapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ' com.itheima.mb.pojo.User'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.itheima.mb.pojo.User
The file path cannot have spaces
边栏推荐
- 数组结构的栈实现
- IO model, multiplexing
- 元气森林:确实在研发不含防腐剂的无糖可乐味产品
- 自定义类加载器实现
- 关于mysql驱动版本报错解决,Cause: com.mysql.jdbc.exceptions.jdbc4、Unknown system variable ‘query_cache_size
- Matlab GUI programming skills (VIII): uitoolbar create toolbar in the drawing window
- PS抠出logo
- ps小白从0开始……
- Assembler Instructions with C Expression Operands
- js类的创建和继承
猜你喜欢
ENVI5.3打开GF-1 WFV数据
B tree and b+ tree hash index
Airtest踩过的坑--启动闪退
QT - graphic view
MCD12Q1数据在ENVI中显示多个分类
Nonparametric test
Matlab GUI programming skills (x): UI figure function to create a visual window
MOD17A3HGF数据下载
Matlab GUI编程技巧(七):matlablistbox操作-列表框(ListBox)和uilistbox常用操作
ECCV 2022 | 修正FPN带来的大目标性能损害:You Should Look at All Objects
随机推荐
用原生js实现放大镜功能
Matlab GUI编程技巧(七):matlablistbox操作-列表框(ListBox)和uilistbox常用操作
Fragmentary knowledge - AB experiment
关于mysql驱动版本报错解决,Cause: com.mysql.jdbc.exceptions.jdbc4、Unknown system variable ‘query_cache_size
ENVI波段合成逆运算——波段拆分
重写与重载
vscode - 所选环境中没有可用的Pip安装程序
数组实现可扩展的循环队列
Arcgis图层标注显示
IO model, multiplexing
Basic settings of visualization
索引
Oracle 关于date 字段索引使用测试
C#中抽象类abstract和接口interface的区别
数组结构的栈实现
接口与抽象类
闻泰科技一季度营收同比猛增184.6%,净利润暴涨256.21%!
零碎知识——机器学习
C# out 关键字error CS0136 无法在此范围中声明该局部变量或参数,因为该名称在封闭局部范围中用于定义局部变量或参数
【MATLAB问题解决】解决Matlab编译后的.exe文件在另一台电脑上无法运行的问题