旧版本驱动问题导致的
当然可以参考其他的方式修改数据库策略
链接
Public Key Retrieval is not allowed
caching-sha2-password
请更新jdbc驱动
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.9</version>
</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