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

時也twilight發表於2020-12-30

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'

相關文章