当前位置:网站首页>mysql版本驱动问题
mysql版本驱动问题
2022-06-09 17:58:00 【西柚dzh】
一直提示Failed to invoke the method getXXX in the service
其中可能包括的错误 pojo类没有实现Serializable 数据库密码错误 数据库驱动版本错误
这里最头疼的是数据库驱动问题, 排查很久都找不出问题,一般就是这个导致的。能搞死人~
查看mysql版本
注意:如果你的版本号是8.0以上的版本,你的数据库连接配置文件db.properties中的数据库地址需要修改为com.mysql.cj.jdbc.Driver,不能用jdbc.driver=com.mysql.jdbc.Driver
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/xxx(此处填你的数据库名)?serverTimezone=UTC&characterEncoding=utf-8&useSSL=false
jdbc.username=root
jdbc.password=***(数据库密码)报错 Error querying database
其实和上面是一个问题,mysql8.0的jdbc版本也要调整
{"code":1,"message":"org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: \r\n### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: com.mysql.cj.jdbc.Driver\r\n### The error may exist in com/qingcheng/dao/BrandMapper.java (best guess)\r\n### The error may involve com.qingcheng.dao.BrandMapper.selectAll\r\n### The error occurred while <!-- mysql 5.x驱动包依赖 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.32</version>
</dependency>
<!-- mysql8.x驱动包依赖 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>版权属于:dingzhenhua 本文链接:https://www.dcmickey.cn/Java/216.html 转载时须注明出处及本声明
边栏推荐
- 得物复杂C端项目的重构实践
- Who says redis can't save big keys
- Application of slip ring in automatic control system
- js中性能优化之函数节流
- C language voter voting function
- NLP - Keyword Extraction - textrank
- Walkthrough - combined use of grouping and aggregation functions
- build sqllite from amalgamation version
- sqllite create a database
- Vulkan specification notes (I) Chapter 1 to Chapter 6
猜你喜欢

华为云零代码开发图片压缩工具

How to realize face verification quickly and accurately?
MySQL Community Server 8.0.29安装配置方法图文教程

Operating instructions for abbexa AEC chromogen Kit

redis源码学习-02_内存分配

二叉树遍历与线索化

Moco -Momentum Contrast for Unsupervised Visual Representation Learning

redis源码学习-03_动态字符串SDS

About concurrency and parallelism, are the fathers of go and Erlang wrong?
MySQL community server 8.0.29 installation and configuration method graphic tutorial
随机推荐
几经波折,InfluxDB的TSDB C位还能做多久?
刨析《C语言》【进阶】付费知识【二】
【高等数学笔记】格林公式、高斯公式、斯托克斯公式、场论
shell记录
Some interesting b+ tree optimization experiments
图片搜索在 Dropbox 中的工作原理
在线沙龙 | 开源小秀场——数据库技术应用实践
sqllite create a database
Word tips
AUTOCAD——坐标引线标注
10分钟快速入门RDS【华为云至简致远】
slurm program running without multiprocess instead run individually
Application of die cutting products in different fields
如何让我们的自建站点拥有自定义域名(1)
日常2琐事^_^
How to learn the process of KD tree construction and search with cases?
新股解读|位列活动内容营销行业第二位,多想云推SaaS产品打造竞争壁垒
AI首席架构师4-AICA-百度CV技术应用及产业落地心得
Android caching mechanism lrucache
演练-分组和聚合函数的组合使用