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

在application.yml文件中配置jpa.hibernate的时候还是要记得

1)最重要的!密码(password)要加双引号!!!!!特别是以零开头的密码!!

2)设置time__zone 为 +8:00

或者:

jdbc.url = jdbc:mysql://localhost:3306/imoocmybatis?characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
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

 

你可能感兴趣的:(JavaDebug)