http://localhost:8899/v1/getUserCount 访问报如下错误
来源:11-2 使用mybatis+SpringBoot完成第一个查询demo

慕粉1728312458
2021-05-25
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Tue May 25 18:22:11 CST 2021
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.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ### The error may exist in file [D:\D\XiaoBao\Chapter11\target\classes\mapper\mysql.xml] ### The error may involve com.course.getUserCount ### 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.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
1回答
-
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection
这个意思是说数据库连接被拒绝了。 检查你数据库的配置
012021-06-01
相似问题