I reinstalled the computer and installed the latest version of MySQL database. As a result, Navicat reported error 1251 when connecting to Mysql, and sqlyog reported error 2058. However, when I entered MySQL with the window command, the account and password were correct. I checked online and found that the reason for this is that the encryption rule in versions before mysql8 is mysql_native_password, while 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. I often use the second method: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; #Modify encryption rules ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #Update the user's password FLUSH PRIVILEGES; #Refresh permissions I see many people just copy the command directly, which is wrong.
So, the problem is solved. The above is the detailed content on how to solve the 1251 error when establishing a connection between MySQL and Navicat. For more information, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: How to automatically backup the script for Linux servers (mysql, attachment backup)
>>: Vue implements carousel animation
Operating environment: MAC Docker version: Docker...
The most common way is to set a primary key or un...
Let's take a look at the command to restart t...
Table of contents 1. In project development, the ...
This article shares the specific code for the WeC...
1. What is ElasticSearch? Elasticsearch is also d...
In front-end development, we are in direct contac...
Query Rewrite Plugin As of MySQL 5.7.6, MySQL Ser...
1. Under 800*600, if the width of the web page is...
background Ever wondered how to create a shadow e...
Table of contents 1: Encapsulation idea 2. Packag...
The Docker Hub we used earlier is provided by Doc...
Simply put, distinct is used to remove duplicates...
Volume Label, Property Name, Description 002 <...
Database performance optimization generally adopt...