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

Solution to HTML2 canvas SVG not being recognized

There is a new feature that requires capturing a ...

Implementation of CSS scroll bar style settings

webkit scrollbar style reset 1. The scrollbar con...

How to install mysql via yum on centos7

1. Check whether MySQL is installed yum list inst...

Example of using #include file in html

There are two files a.htm and b.htm. In the same d...

vue-electron problem solution when using serialport

The error is as follows: Uncaught TypeError: Cann...

How to implement page jump in Vue project

Table of contents 1. Create a vue-cli default pro...

What does this.parentNode.parentNode (parent node of parent node) mean?

The parent node of the parent node, for example, t...

H tags should be used reasonably in web page production

HTML tags have special tags to handle the title of...

HTML+CSS+JavaScript to create a simple tic-tac-toe game

Table of contents Implementing HTML Add CSS Imple...

How to use docker to build redis master-slave

1. Build a Docker environment 1. Create a Dockerf...

Two ways to visualize ClickHouse data using Apache Superset

Apache Superset is a powerful BI tool that provid...

80 lines of code to write a Webpack plugin and publish it to npm

1. Introduction I have been studying the principl...

Vue implements countdown function

This article example shares the specific code of ...

Introduction to 10 Hooks in React

Table of contents What is ReactHook? React curren...

Super detailed MySQL8.0.22 installation and configuration tutorial

Hello everyone, today we are going to learn about...