在进行springboot绑定的redis缓存和mysql数据库的时,运行出现了Access denied for user ''@'localhost' (using password: NO)操作,检查了防火前和对应的端口号都已经开放,又重新查看配置文件发现:在spring的datasource的username和password前面都加上了data的前缀,因为这个导致报错。修改后重新运行,问题解决,正常运行可查!
server:
port: 8080
spring:
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/dict?useSSL=false
username: root
password: root
redis:
sentinel:
master: mymaster
nodes:
- 192.168.37.126:26379
- 192.168.37.126:26380
- 192.168.37.126:26381
修改后是:



