菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
128
0

spring boot Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection;

原创
05/13 14:22
阅读数 88169

解决报错

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Jan 07 21:06:43 CST 2020
There was an unexpected error (type=Internal Server Error, status=500).
nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. ### The error may exist in com/imooc/mapper/StuMapper.java (best guess) ### The error may involve com.imooc.mapper.StuMapper.selectByPrimaryKey ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

检查数据库名 密码 端口无误后

修改包的版本

将 

   <version>5.1.41</version>

  改为

   <version>5.1.47</version>

重新运行项目 报错解决 可以调接口

{"id":1001,"name":"test","age":20}

发表评论

0/200
128 点赞
0 评论
收藏