SpringBoot中yml配置java.sql.SQLException: Access denied for user ‘root‘@‘localhost‘ (using password: NO

IDEA自动补全改成了“data-password”

spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/limbus?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
    username: root
    data-password: '123456'

正确写法如下

spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/limbus?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
    username: root
    password: '123456'

你可能感兴趣的:(springboot,spring,spring,boot,数据库)