Navicat连接mysql版本出现1251--Client does not support authentication protocol requested by server的解决方案

参考来源:https://blog.csdn.net/XDMFC/article/details/80263215
1、安装好MySQL数据库后,用Navicat for MySQL连接本地数据库时出现错误:1251–Client does not support authentication protocol requested by server,即版本不兼容问题,参考以下解决方案:

1)首先进入MySQL安装目录的bin目录,在命令行下登录数据库:

....mysql\bin>mysql -hlocalhost -uroot -p

2) 输入登录密码;
3)登录成功后在mysql命令下更改mysql加密方式(将密码设置为永不过期模式);

mysql>alter user 'root'@'localhost' identified by 'yourpassword' password expire never;

4) 更改密码(在这里将新密码设置为123456);

mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

5) 最后,刷新权限让更改的数据文件立即生效;

mysql>flush privileges;

6)问题解决,再次用Navicat连接mysql, 如果还有其他报错信息,欢迎评论区给我留言;

猜你喜欢

转载自blog.csdn.net/AwayFuture/article/details/82559870