解决控制台问题Connections could not be acquired from the underlying database!

搭建SSM运行时出行该问题

网页报

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!





锁定database的connection问题
检查1:driver :2020版的idea好像都需要加cj;
com.mysql.cj.jdbc.Driver
检查2:URL    :2020版的idea好像都需要加时区;serverTimezone=Asia/Shanghai

检查3:username and password

检查四:依赖版本问题(我的问题出现在这,我的MySQL是8.0版本的,copy时注意版本问题)
检查,idea and maven and spring and MySQL and mybatis and连接池等的依赖包版本

检查五:检查数据库是否开启;
这是我的问题,希望对你有所借鉴;
posted @ 2021-01-28 11:33  鷄你太美  阅读(448)  评论(0编辑  收藏  举报