Solve the problem of 1251 when Navicat connects to MySQL database

problem:

Client does not support authentication protocol requested by server;upgrading MYSQL Client

 

Solution:

1. Open the cmd window, enter the bin directory of the mysql installation directory, enter: mysql -u root -p to connect to the database, then enter the password, and press Enter

2. Enter the following commands respectively:

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

3. Reopen Navicat, enter the account and password, and click the "connection test" button. At this time, it will appear: connection is successful

4. Click "OK" to successfully connect to the database

 

 

 

Guess you like

Origin blog.csdn.net/weixin_43184774/article/details/106613136