启动成功以后点击登录接口报错

来源:4-2 调试项目

Vssscott

2022-04-07 10:28

程序里的报错:

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

点击登录接口后网页里的报错:

Whitelabel Error Page

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

Wed Apr 06 22:24:48 EDT 2022

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 file [C:\Users\njlsh\IdeaProjects\IDEA demo project\target\classes\mapper\UserMapper.xml] ### The error may involve com.imooc.demo.mapper.UserMapper.findByLoginName ### 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.



写回答 关注

1回答

  • 画1164367
    2022-04-25 14:18:28

    连接数据库那错了

开发工具IDEA从入门到爱不释手

全面了解开发工具idea的常用操作,快速提高开发效率。

34255 学习 · 33 问题

查看课程

相似问题