使用navicat连接数据库时候出现了1251错误

其中连接错误的原因的使用了8.0.xx的版本,所以采用的是新的保密方式不能使用旧的连接方式,需要修改密码;首先使用管理者模式打开cmd输入mysql -uroot -p进入mysql,然后输入root的密码

然后输入
mysql> use mysql
Database changed
mysql> alter user root@localhost identified with mysql_native_password by '(你的新密码)';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
再次使用会出现

如果以上方法还是无法成功解决1251错误可以考虑重装数据库。
网友评论