Springboot+MySQL,出现Could not get JDBC Connection

Rebecca ·
更新时间:2024-09-20
· 877 次阅读

Caused by: org.apache.ibatis.exceptions.PersistenceException: Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO) The error may exist in com/atguigu/cache/mapper/EmployeeMapper.java (best guess) The error may involve com.atguigu.cache.mapper.EmployeeMapper.getEmpById

##网上有很多原因以及解决办法,但就是找不到解决我的问题的办法。当初我遇到时,搞的我头都炸了。
[ ]密码错误?好,我改。改了还是不对。
[ ]难道是MySQL 8.0 的问题?好,我换 5.7。换了还是不对。
[ ]滚吧,lz不玩了。

问题所在:在这里插入图片描述

最后,是把老师的代码直接复制过来,才发现问题,要是不Ctrl+C+V,恐怕自己永远也发现不了。小小记录一下,都怪自己太傻了,留在这,给后面的兄弟姐妹提个醒吧。


作者:稳稳@1998



get springboot NOT CONNECTION jdbc Mysql

需要 登录 后方可回复, 如果你还没有账号请 注册新账号