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

Three: An error appears
when you install MySQL, we now generally use Navicat to connect to the database, but the following error occurs: 1251-Client does not support authentication protocol requested by server; consider upgrading MySQL client.

The reason for the above problem is: the previous version of mysql8 encryption rule is mysql_native_password, and after mysql8, encryption rules are caching_sha2_password the mysql user password encryption rule reduced to mysql_native_password

I installed the installation package is used to install, so several new user, cmd command, connect mysql, query system among all users.

1. Check the MYSQL database for all users

MySQL> the SELECT DISTINCT CONCAT ( 'the User:' '', the User, '' '@' '', Host, '' ';') AS Query the FROM the mysql.user;
2. modify the encryption rule, because the latest version of the encryption rule it seems not the same, the process of installation is suggested.

MySQL> the ALTER the USER 'the root' @ 'localhost' the IDENTIFIED BY 'password' PASSWORD the EXPIRE NEVER;
3. Modify user authentication rules

mysql> alter user 'username' @ '%' identified with mysql_native_password by ' password';
for example, my username is admin, password is 123456, then I modified the rules are as follows

mysql> alter user 'admin' @ '%' identified with mysql_native_password by '123456';
the difference between which there 'username' @ '%' and 'username' @ 'localhost', one is any connection, a local connection.

4. Refresh rights

MySQL> flush
privileges; ----------------
Disclaimer: This article is CSDN bloggers "could not dream dream dream dream dream" of the original article, follow the CC 4.0 BY- SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/qq_38455201/article/details/83024357

Guess you like

Origin www.cnblogs.com/niewd/p/12175243.html