MySQL 使用Navicat连接MySQL8出现1251错误

安装了MySQL8.x.x后使用Navicat连接总是出现1251错误,故在此记录一下解决方法。

错误提示

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

解决办法

用管理员身份打开cmd,输入"mysql -u root -p [-h locahost -P 3306]"(中括号内是默认内容)回车输入root用户密码进入MySQL客户端,然后:

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

mysql> alter user root@localhost identified with mysql_native_password by 'PasswordOfRoot';

mysql> flush privileges;

其中,"PasswordOfRoot"是root用户密码。
此时,Navicat可以连接成功,问题解决!

  至此。转载请注明出处。

猜你喜欢

转载自www.cnblogs.com/wcwnina/p/9569535.html