Navicat connection mysql error 1251 solution
1. Newly installed mysql8, use the cracked version of navicat It keeps reporting an error when connecting, as shown in the figure:
2. Searching the Internet for the reason, I found that the encryption rule in versions before mysql8 was mysql_native_password, but after mysql8, the encryption rule It is caching_sha2_password. There are two ways to solve the problem. One is to upgrade the navicat driver, and the other is to restore the mysql user login password encryption rule to mysql_native_password. Since I am using a cracked version of Navicat, I can only use the second method to solve it.
Related recommendations: "Navicat for mysql graphic tutorial"
3. First run cmd as an administrator, and then use the command to enter mysql.
Then enter the root password you set when installing mysql to enter. The interface after entering is as follows:
Note: If you enter mysql -u root -p, cmd prompts that mysql is not an internal or external command, nor is it an operable program or Batch file, it means that you did not add the path of mysql to the environment variable PATH after installing mysql before. This method is suggested at the end of the article;
4. Then change the encryption method in mysql first. The instructions are as follows:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
5. Then change the password. Due to the change of encryption rules, So you need to reset the password;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';
6. Finally, refresh the database;
FLUSH PRIVILEGES;
Finally, write down how to add the path to mysql in the environment variable PATH;
1. Win r-->services.msc-->Right-click the mysql service-->Properties-->Find the executable path and copy it;
2. Right-click "My Computer"-->Properties-->Advanced System Settings-->Environment Variables-->System Variables-->PATH-->Edit-->New-->"Executable" above Path", as shown below:
The above is the detailed content of What should I do if navicat reports error 1251?. For more information, please follow other related articles on the PHP Chinese website!