连接mysql报错:errorCode 1251, state 08004,Client does not support authentication protocol requested
Posted zhangphil
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了连接mysql报错:errorCode 1251, state 08004,Client does not support authentication protocol requested相关的知识,希望对你有一定的参考价值。
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里面有定义,把里面这样写:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
以上是关于连接mysql报错:errorCode 1251, state 08004,Client does not support authentication protocol requested的主要内容,如果未能解决你的问题,请参考以下文章
Navicat11.1连接Mysql8.0报错1251的解决办法
Navicat 远程连接docker容器中的mysql 报错1251 - Client does not support authentication protocol 解决办法
Navicat 远程连接docker容器中的mysql 报错1251 - Client does not support authentication protocol 解决办法