从MySql5.7版本跳到了Mysql 8.0的版本,安装的时候提示链接加密方式已经改变,是选择5.?时代的方式还是新的方式,当时 全部选择默认,所以选择的新的 加密方式,然后 装好之后Navicat远程连接就一直报错1251
如图所示:1251-Client does not support authentication protocol requested by server;
解决办法: 更改加密方式;
1.以root账户用户登录Mysql:(CMD里面输入)
PS C:\Users\Dingzg-Pro> mysql -u root -p
C:\Users\Dingzg-Pro> mysql -u root -p
2.更改加密方式:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.10 sec)
3.更改密码:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';
Query OK, 0 rows affected (0.35 sec)
4.刷新:
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.28 sec)
最后终于连接上了,如图所示,不再报错: