连接mysql报错:errorCode 1251, state 08004,Client does not support authentication protocol requested

红太狼 2023-09-24 16:47 99阅读 0赞

idea spring项目启动后连接mysql报错:errorCode 1251, state 08004,Client does not support authentication protocol requested by server; consider upgrading MySQL client …

报错内容摘要:

… errorCode 1251, state 08004

Client does not support authentication protocol requested by server; consider upgrading MySQL client …

网上普遍给出的方案是这样的:

ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’
flush privileges;

但其实报错的根因是mysql的连接器依赖有些问题,消息提示已经指明,需要升级mysql,具体的说就是升级musql连接器而已,mysql连接器在pom.xml里面有定义,把里面这样写:

  1. <dependency>
  2. <groupId>mysql</groupId>
  3. <artifactId>mysql-connector-java</artifactId>
  4. </dependency>

发表评论

表情:
评论列表 (有 0 条评论,99人围观)

还没有评论,来说两句吧...

相关阅读