Home > Database > navicat > body text

How to solve the 1251 error when establishing connection between mysql and navicat

爱喝马黛茶的安东尼
Release: 2019-08-03 15:05:14
Original
3715 people have browsed it

How to solve the 1251 error when establishing connection between mysql and navicat

I reinstalled the computer and installed the latest version of the MySQL database. As a result, Navicat reported a 1251 error when connecting to Mysql, and sqlyog reported a 2058 error. However, the window command entered mysql, and the account and password were correct. .

How to solve the 1251 error when establishing connection between mysql and navicat

I checked online that the reason for this is that the encryption rule in versions before mysql8 is mysql_native_password, but after mysql8, the encryption rule is caching_sha2_password.

There are two ways to solve the problem. One is to upgrade the navicat driver; the other is to restore the mysql user login password encryption rule to mysql_native_password.

Related recommendations: "Navicat for mysql graphic tutorial"

I often use the second method:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; #修改加密规则 
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #更新一下用户的密码 
FLUSH PRIVILEGES; #刷新权限
Copy after login

I think many people It is wrong to copy directly with the command.

'root' The user name defined for yourself

'localhost' refers to the IP open to the user, which can be 'localhost' (only local access, equivalent to 127.0.0.1) , it can be a specific '*.*.*.*' (a specific IP), or it can be '%' (all IPs can be accessed)

'password' is the user password you want to use

In this way, the problem is solved.

The above is the detailed content of How to solve the 1251 error when establishing connection between mysql and navicat. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!