1. 程式人生 > >springboot com.mysql.cj.exceptions.CJException: Access denied for user 'root'@'localhost

springboot com.mysql.cj.exceptions.CJException: Access denied for user 'root'@'localhost

在application.yml檔案中配置jpa.hibernate的時候還是要記得

1)最重要的!密碼(password)要加雙引號!!!!!特別是以零開頭的密碼!!

2)設定time__zone 為 +8:00

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost/girl
    username: root
    password: "0111"

  jpa:
    hibernate:
      ddl-auto: update
    show-sql: true
    database: mysql