问题

Connections could not be acquired from the underlying database!

出错,最后发现我的mysql版本是8.x 导入的依赖是5.x版本

排查问题步骤:

1.查看 mysql 数据库中是否创建了相应的表

2.查看账号密码和driver信息 是否输入正确

这个是5.x的版本的driver

jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC
jdbc.username=root
jdbc.password=root

这个是8.x的版本的driver

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
jdbc.username=root
jdbc.password=root

3.首先查看你的mysql版本,导入相应的依赖或者相应的jar包

cmd输入 MySQL -V

 <dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.21</version></dependency>
<!--    5.x版本-->
<!--    <dependency>-->
<!--      <groupId>mysql</groupId>-->
<!--      <artifactId>mysql-connector-java</artifactId>-->
<!--    <version>5.1.32</version>-->
<!--    </dependency>--><dependency><groupId>c3p0</groupId><artifactId>c3p0</artifactId><version>0.9.1.2</version></dependency>

4.数据库未启动或无权访问

5.远程访问时,mysql root没有访问的权限

解决:Connections could not be acquired from the underlying database!相关推荐

  1. 新手解决Connections could not be acquired from the underlying database!Java代码上传到服务器连接不上数据库

    本人刚入门Java,最近在开发一个项目,由于项目中有些问题需要与客户沟通.就想着把程序先上传到服务器上,先是上传到我之前用的服务器,服务器没有配置Java 环境.我自己配置好环境后把编译后代码上传上去 ...

  2. 解决Connections could not be acquired from the underlying database!

    之前一直认为是代码错了,后来网上查资料,发现可能是C3P0和mysql的版本不匹配导致的,更改完C3P0的版本 以后就好了,更改完的版本如下: <dependency><groupI ...

  3. 解决:Connections could not be acquired from the underlying database!(mysql)

    这两天一直有这个bug出现,记录一下解决方案和总结. 解决方案: 1.驱动配置错误(本人的bug) 2.数据库连接地址错误 3.账号密码错误 4.数据库未启动或者无权访问,如没有联网的情况下 5.版本 ...

  4. SSM:出现Connections could not be acquired from the underlying database异常的解决

    QUESTION:SSM:出现Connections could not be acquired from the underlying database异常的解决 ANSWER: 近期在学习ssm框 ...

  5. Connections could not be acquired from the underlying database异常,已解决。

    问题描述 在运用JDBC连接数据库时,用的是C3P0数据源,出现Connections could not be acquired from the underlying database!这个异常 ...

  6. 【JDBC 报错】Connections could not be acquired from the underlying database!

    项目启动报错: 1 [2016-07-13 10:04:15,074] ERROR org.apache.ibatis.executor.BaseExecutor Could not get a da ...

  7. Hibernate 错误记录Connections could not be acquired from the underlying database!

    Hibernate 错误记录Connections could not be acquired from the underlying database! 错误详情 网上的解决办法 我的错误解决 错误 ...

  8. Oracle 换库时发生 Connections could not be acquired from the underlying database

    在进行数据库切换发生如下错误: Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionExce ...

  9. 数据库连接问题Connections could not be acquired from the underlying database!

    问题:Connections could not be acquired from the underlying database! 1.无法从底层数据库获取连接 1.1.首先日常打开自己的项目,运行 ...

最新文章

  1. 在CentOS 6.3/6.6 64bit上源码安装cmake 3.4.0
  2. jzoj2940-生成输入数据【最小生成树,并查集】
  3. express中connect-flash中间件的使用
  4. linux下源码安装vsftpd-3.0.2
  5. lisp语言cond和if套用_LISP - 决策
  6. m1芯片MacBook Air安装arm版MacTeX及配置
  7. Linux移植随笔:又遇困难
  8. 2018-携程-春招题
  9. 浅谈非法NAT接入对网络的安全风险
  10. 【李宏毅2020 ML/DL】P14 Tips for training DNN | 激活函数、Maxout、正则、剪枝 Dropout
  11. ENVI学习总结——基于改进的 CASA 模型反演NPP
  12. Layui文件上传样式在ng-dialog不显示的问题处理
  13. Xcode debug时如何看crash的call stack
  14. IDEA项目can not reconnect错误
  15. JAVA在线考试管理系统(源代码+论文+开题报告+外文翻译+英文文献+答辩PPT)
  16. Ubuntu 16.04 显卡型号查询命令
  17. Python3中True、False、None等含义详解
  18. 防止Form表单重复提交的客户端及服务器端的方式
  19. centos搭建简单自用syslog服务器
  20. 一个研究生毕业以后的人生规划(转自天涯虚拟社区)

热门文章

  1. WDBS世界数字经济与区块链大会杭州站圆满落幕
  2. 博客园自定义样式主题 -- cnblogs theme
  3. P2887 [USACO07NOV]防晒霜Sunscreen - 贪心
  4. 小米蒸排骨+炒红萝卜丝+苦瓜炒蛋
  5. 邻接矩阵用c语言,邻接矩阵无向图(一)之 C语言详解
  6. crossorigin
  7. 2021年改版之后的微信小程序获取头像及返回
  8. [转]北京ATM跨行取款学问多(2008年07月26日)
  9. 堪比 007 电影!通过一张照片找到拍照者的精确位置
  10. 生命是一种长期而持续的累积 - 台湾清华彭明辉老师 [转]