SpringBoot Access denied for user ''@'localhost' (using password: NO)
Posted astrand
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SpringBoot Access denied for user ''@'localhost' (using password: NO)相关的知识,希望对你有一定的参考价值。
springboot做demo出现错误,java.sql.SQLException:对用户‘‘@ localhost‘拒绝访问(使用密码:NO)
java.sql.SQLException: Access denied for user ‘‘@‘localhost‘ (using password: NO)
根据提示发现是“ ”用户访问而不是“root”用户,估计是idea提示写的代码 data-username: root 格式不对于是尝试更改,最终成功
更改前
spring:
mvc:
view:
prefix: /WEB-INF/views/
suffix: .jsp
datasource:
url: jdbc:mysql://127.0.0.1:3306/sqtest
data-username: root
data-password: 123456
driver-class-name: com.mysql.jdbc.Driver
更改后
datasource:
url: jdbc:mysql://127.0.0.1:3306/sqtest
username: root
password: 123456
driver-class-name: com.mysql.jdbc.Driver
以上是关于SpringBoot Access denied for user ''@'localhost' (using password: NO)的主要内容,如果未能解决你的问题,请参考以下文章
springboot java.sql.SQLException: Access denied for user ''@'localhost' (using pass
用springboot连接数据库时出现如下错误java.sql.SQLException: Access denied for user ''@'localhost'
403 - Forbidden: Access is denied. 是啥意思啊?! 如何解决?