mysql8 :客户端连接caching-sha2-password问题&MySQL throws "Public Key Retrieval is not allowed"

旧版本驱动问题导致的
当然可以参考其他的方式修改数据库策略
链接
Public Key Retrieval is not allowed
caching-sha2-password

请更新jdbc驱动

 <dependency>
    <groupId>mysqlgroupId>
    <artifactId>mysql-connector-javaartifactId>
    <version>8.0.11version>
 dependency>
  <dependency>
     <groupId>com.alibabagroupId>
     <artifactId>druidartifactId>
     <version>1.1.9version>
  dependency>

配置文件

 datasource:
    url: jdbc:mysql://127.0.0.1:3306/****?useSSL=false&serverTimezone=Asia/Shanghai
    username: *****
    password: *****
    driver-class-name: com.mysql.cj.jdbc.Driver
    type: com.alibaba.druid.pool.DruidDataSource

你可能感兴趣的:(mysql8 :客户端连接caching-sha2-password问题&MySQL throws "Public Key Retrieval is not allowed")