maven+springmvc出现:java.sql.SQLException: Unknown system variable 'query_cache_size'
2024-10-12 01:21:41
连接mysql时一直出现以下的错误:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) 然后就将“
Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
” 当做问题的根源去搜索答案(当然,一搜发现这种错误还是挺多的)但是并不是我想要的答案 后来看到控制台的信息:
java.sql.SQLException: Unknown system variable 'query_cache_size'
原来这才是问题的根源所在!!! 原因是mysql驱动的版本号不匹配!!!(这篇博客简直是救我于水深火热之中)
直接抄过来了
如果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' 解决办法,到maven依赖查询 去找到你安装的mysql的版本对应的驱动版本号的配置 解决了这问题,又出现时区的问题,woc!!! The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. 请移步至这篇博客
最新文章
- 下载最新版本的Oracle Database
- C# 获取指定目录下所有文件信息、移动目录、拷贝目录
- linux内核追踪——find_next_bit函数详详详解
- 18TH赛事管理
- Intellij Idea使用技巧、快捷键
- c++ 构造函数,拷贝构造函数,析构函数与赋值操作符
- ICMP协议
- ssh远程登录linux live系统
- LDA 线性判别分析
- 分类导航菜单的制作(附源码)--HTML
- A*寻路算法入门(二)
- 手把手教你提交文件到git
- 7.3 GRASP原则三: 低耦合 Low Coupling
- Linux下安装Anaconda
- list(zip(*querySet))使用
- Java 模仿 C# 字典 一例
- 【转】多线程:C#线程同步lock,Monitor,Mutex,同步事件和等待句柄(上)
- 【Atcoder】ARC102 题解
- BZOJ 1009 [HNOI2008]GT考试 (KMP + 矩阵快速幂)
- Java并发编程原理与实战十一:锁重入&;自旋锁&;死锁
热门文章
- python全栈开发 * 27知识点汇总 * 180710
- LINUX常用命令 --- 权限篇
- 20165311 ch02 课下作业
- RoR- Database setup&; SQLite ... Migrations
- Vue Watch 的原理 和 $nextTick() 通俗理解
- pandas处理时间序列(1):pd.Timestamp()、pd.Timedelta()、pd.datetime( )、 pd.Period()、pd.to_timestamp()、datetime.strftime()、pd.to_datetime( )、pd.to_period()
- js中变量名加“-” new Vue()不执行
- VS2015 新建 ASP.NET Web应用程序, 此模板尝试加载程序集‘Microsoft.VisualStudio.Web.Project’, 解决方案
- Android-Gradle(一)
- Python 第五阶段 学习记录之----ORM