MySQL8.0,发现Navicat连接不上,总是报错1251;

原因是MySQL8.0版本的加密方式和MySQL5.0的不一样,连接会报错。

更改加密方式

1.先打开MySQL8.0 Command Line Clint输入root密码:

Navicat连接MySQL8.0连接不上,总是报错1251_加密方式

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 '123456';
Query OK, 0 rows affected (0.35 sec)

4.刷新:

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.28 sec)