nested exception is org.apache.ibatis.exceptions.PersistenceException:

nested exception is org.apache.ibatis.exceptions.PersistenceException:,第1张

nested exception is org.apache.ibatis.exceptions.PersistenceException:

问题:

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 com/ssmbuild/dao/BookMapper.xml
### The error may involve com.ssmbuild.dao.BookMapper.queryAllBook
### 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!

解决

尝试了很多方法,最后还是url的问题:

原有的:

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/ssmbuilduseSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=CST
jdbc.username=root
jdbc.password=***

现在的:

jdbc.url=jdbc:mysql://localhost:3306/ssmbuild?characterEncoding=utf-8&serverTimezone=GMT

就可以连接成功啦

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5660843.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-16
下一篇2022-12-16

发表评论

登录后才能评论

评论列表(0条)

    保存