Solve the 1251 error when establishing a connection between mysql and navicat

Solve the 1251 error when establishing a connection between mysql and navicat

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.

1564815512720381.png

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.

  • 'root' is your own username
  • 'localhost' refers to the IP opened by the user. It can be 'localhost' (accessible only by this local machine, equivalent to 127.0.0.1), it can be a specific '*.*.*.*' (a specific IP), or '%' (accessible by all IPs)
  • 'password' is the user password you wish to use

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:
  • Navicat connection MySQL error description analysis
  • Solve the problem of Navicat for MySQL reporting 2005 error when connecting to MySQL
  • Common errors and solutions for connecting Navicat to virtual machine MySQL
  • Navicat connects to MySQL8.0.11 and an error 2059 occurs
  • When Navicat connects to MySQL, it reports 10060, 1045 errors and the location of my.ini
  • Solve the 3680 error when creating a new database in Navicat on Mac

<<:  How to automatically backup the script for Linux servers (mysql, attachment backup)

>>:  Vue implements carousel animation

Recommend

How to create an Nginx server with Docker

Operating environment: MAC Docker version: Docker...

4 ways to avoid duplicate insertion of data in Mysql

The most common way is to set a primary key or un...

Detailed explanation of data sharing between Vue components

Table of contents 1. In project development, the ...

WeChat applet implements calculator function

This article shares the specific code for the WeC...

How to deploy ElasticSearch in Docker

1. What is ElasticSearch? Elasticsearch is also d...

Detailed explanation of the use of CSS pointer-events attribute

In front-end development, we are in direct contac...

Use of MySQL query rewrite plugin

Query Rewrite Plugin As of MySQL 5.7.6, MySQL Ser...

Web design dimensions and rules for advertising design on web pages

1. Under 800*600, if the width of the web page is...

CSS achieves colorful and smart shadow effects

background Ever wondered how to create a shadow e...

Steps to encapsulate the carousel component in vue3.0

Table of contents 1: Encapsulation idea 2. Packag...

How to build DockerHub yourself

The Docker Hub we used earlier is provided by Doc...

The difference between distinct and group by in MySQL

Simply put, distinct is used to remove duplicates...

HTML Grammar Encyclopedia_HTML Language Grammar Encyclopedia (Must Read)

Volume Label, Property Name, Description 002 <...