mysql 链接时报错:1251-Client does not support authentication protocol requested by server
2023-09-27 14:21:39 时间
navicat for mysql 链接时报错:1251-Client does not support authentication protocol requested by server
本文被收录于专区
客户端使用navicat for mysql。本地安装了mysql 8.0。但是在链接的时候提示:
主要原因是mysql服务器要求的认证插件版本与客户端不一致造成的。
打开mysql命令行输入如下命令查看,系统用户对应的认证插件:
可以看到root用户使用的plugin是caching_sha2_password,mysql官方网站有如下说明:
意思是说caching_sha2_password是8.0默认的认证插件,必须使用支持此插件的客户端版本。
plugin的作用之一就是处理后的密码格式和长度是不一样的,类似于使用MD5加密和使用base64加密一样对于同一个密码处理后的格式是不一样的。
解决方法:
我不希望更新本地的客户端版本,想直接使用原来的环境来链接。
解决方法是将root的plugin改成mysql_native_password。相当于降了一级。
mysql官方网站提供了从mysql_old_password升级到mysql_native_password,我们可以仿照这个。官方原文如下:
这里改成:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
这行代码有两层含义,第一:修改root的密码为'root',摒弃原来的旧密码。第二:使用mysql_native_password对新密码进行编码。
修改完成后再用客户端登陆成功:
补充:
如果在修改插件的时候出现错误,可现将插件改为 mysql_old_password,然后再升级成mysql_native_password,方法:
相关文章
- MySQL学习笔记_8_SQL语言基础复习
- 一文搞定MySQL聚合函数
- 【数据库开发】is not allowed to connect to this MySQL server解决办法
- MySQL远程连接丢失问题解决方法Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- Mysql 8.0 my.ini 系统变量设置--Server System Variable Reference
- MySQL性能管理及架构设计 学习视频 分享
- MYSQL导入CSV格式文件数据执行提示错误(ERROR 1290): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement.
- 分析Mysql 5.6的Dockerfile
- 第三章 mybatis-generator + mysql/ptsql
- 精品spring boot+MySQL微人事系统设计与实现vue
- 必看的100道MySQL数据库经典面试题解析,附大厂真题面经
- Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the
- MySQL数据导出与导入
- mysql 中 DATE_ADD函数和 DATE_SUB函数用法
- Docker容器启动lnmp环境下的mysql服务时报"MySQL server PID file could not be found"错误解决办法
- 数据库服务器的安装 (MySQL Server 5.7) :
- mysql主从复制错误:A slave with the same server_uuid/server_id as this slave has connected to the master;
- 【云原生】阿里云ACK部署MySQL & 数据持久化存储
- 【Mysql】只保留最新的10条数据,其余数据删除的sql语句怎么写
- Java,Mysql-根据一个给定经纬度的点,进行附近500米地点查询–合理利用算法
- XtraBackup出现 Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
- can't connect to mysql server on localhost <10061>
- ubuntu18.04 安装mysql server
- 提高性能,MySQL 读写分离环境搭建
- Can't connect to MySQL server on 'ip' (13)
- The last packet sent successfully to the server was 0 milliseconds ago.[nutch---mysql ]
- 大数据Canal(三):使用Canal同步MySQL数据
- oracle 12.2+支持mysql与postgresql中的collate(排序规则)特性
- MYSQL错误解决:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
- mysql 查找重复的数据
- navicat连接mysql出现Client does not support authentication protocol requested by server解决方案