Home > Database > Mysql Tutorial > body text

What should I do if a 1251 error occurs when Navicat connects to Mysql8.0.11?

醉折花枝作酒筹
Release: 2021-05-24 10:03:36
forward
2245 people have browsed it

This article will introduce to you how to solve the 1251 error when Navicat connects to Mysql8.0.11. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

What should I do if a 1251 error occurs when Navicat connects to Mysql8.0.11?

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 both is correct.

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, and 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'; #修改加密规则 
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #更新一下用户的密码 
FLUSH PRIVILEGES; #刷新权限
Copy after login

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

'root' Define the user name 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 what you want to use User password

Recommended learning: php video tutorial

The above is the detailed content of What should I do if a 1251 error occurs when Navicat connects to Mysql8.0.11?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
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!