为了账号安全,请及时绑定邮箱和手机立即绑定

无法获取数据库连接

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

### The error may exist in file [C:\Users\菲菲\IdeaProjects\test\target\classes\mapper\AreaDao.xml]

### The error may involve com.example.test.dao.AreaDao.queryArea

### The error occurred while executing a query

### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!


正在回答

2 回答

jdbc.driverClass   = com.mysql.cj.jdbc.Driver

jdbc.url      = jdbc:mysql://127.0.0.1:3306/db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT



1 回复 有任何疑惑可以回复我~
  1. 你可以先看看你的数据库url配置是否少了数据库名

  2. 或者你的配置缺少了什么,比如空格,单词,或者末尾是不是多了个空格

  3. 如果你的数据库是mysql-connector-java 6.0.x版本,driver是com.mysql.cj.jdbc.Driver

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

无法获取数据库连接

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信