Home  >  Article  >  Database  >  What should I do if navicat reports error 1251 when connecting to mysql?

What should I do if navicat reports error 1251 when connecting to mysql?

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-08-13 15:38:3330543browse

What should I do if navicat reports error 1251 when connecting to mysql?

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:

What should I do if navicat reports error 1251 when connecting to mysql?

2. Searching the Internet for the reason found that the encryption rule in versions before mysql8 was mysql_native_password, but after mysql8, the encryption rule is caching_sha2_password.

Related recommendations: "Navicat for mysql graphic tutorial"

There are two ways to solve the problem, one is to upgrade the navicat driver; the other is to change the mysql user The login password encryption rule is restored to mysql_native_password. Since I am using a cracked version of navicat, I can only use the second method to solve it.

3. First run cmd as administrator, and then use the command to enter mysql.

What should I do if navicat reports error 1251 when connecting to mysql?

#Then enter the root password you set when you installed mysql to enter. The interface after entering is as follows:

What should I do if navicat reports error 1251 when connecting to mysql?

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. Since the encryption rules have changed, you need to re- Set 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 Path" above, as the picture shows:

What should I do if navicat reports error 1251 when connecting to mysql?

What should I do if navicat reports error 1251 when connecting to mysql?

The above is the detailed content of What should I do if navicat reports error 1251 when connecting to mysql?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Is navicat free?Next article:Is navicat free?