解决报错

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}

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

相关文章:

  • 2022-03-07
  • 2022-12-23
  • 2021-07-18
  • 2021-10-24
  • 2021-12-16
  • 2021-09-09
  • 2022-12-23
  • 2021-04-12
猜你喜欢
  • 2021-06-30
  • 2022-01-01
  • 2021-07-07
  • 2021-05-13
  • 2022-12-23
  • 2021-10-22
  • 2021-12-25
相关资源
相似解决方案