项目场景:
springcloud阿里巴巴支付模块项目构建
问题描述
启动spring cloud时数据源报错:
com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: jdbc:mysql://localhost:3306/db2019?useUnicode=true&characterEncoding=utf-8&useSSL=false, errorCode 1251, state 08004com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client
解决方案:
更改mysql-connect版本,改为8.0.23,application.yml
文件中spring datasource mysql驱动更改为com.mysql.cj.jdbc.Driver,如下图