Spring Boot : Access denied for user ''@'localhost' (using password: NO)

spring.datasource.username 写成了  spring.datasource.data-username
spring.datasource.password 写成了 spring.datasource.data-password

声明:网上有很多的解决方案,可以去尝试;我这里的导致这个出错原因比较低级。用来提醒自己检查的。

(1)解决方案

出现问题也有可能是application.xml的数据库配置错误导致:

出错原因:

数据库配置书写错误:

(2)下面具体分析

② 浏览器访问出错

③ 后台报错显示:

④ 解决方案:

网上一大片内容,最终找到和我解决问题方案一致:

https://www.cnblogs.com/astrand/p/10329645.html

⑤ 总结:

书写配置之前,注意细节。最好是多手写配置,减少 IDEA或其他IDE的辅助插件自动功能。

猜你喜欢

转载自www.cnblogs.com/superdrew/p/13379344.html