出现Client does not support authentication protocol requested by server

初始化数据库

其中Ey7;tii<cd8/是mysql密码

G:\mysql-8.0.19-winx64\bin>mysqld --initialize --console
2020-02-10T00:24:59.176017Z 0 [System] [MY-013169] [Server] G:\mysql-8.0.19-winx64\bin\mysqld.exe (mysqld 8.0.19) initializing of server in progress as process 2812
2020-02-10T00:25:21.564988Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Ey7;tii<cd8/

MySQL安装

G:\mysql-8.0.19-winx64\bin>mysqld install
Service successfully installed.

MySQL服务启动

G:\mysql-8.0.19-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

关闭MySQL服务

G:\mysql-8.0.19-winx64\bin>net stop mysql

MySQL登录

方法一:mysql -u root -p

输入密码,其中Ey7;tii<cd8/是mysql密码

G:\mysql-8.0.19-winx64\bin>mysql -u root -p
Enter password:

方法二:mysql -h 主机名 -u 用户名 -p

G:\mysql-8.0.19-winx64\bin>mysql -h localhost -u root -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 8.0.19 MySQL Community Server - GPL

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

MySQL密码进行修改

ALTER USER ‘root’@‘localhost’ identified by ‘123456’ ;

mysql> ALTER USER 'root'@'localhost' identified by '123456' ;
Query OK, 0 rows affected (0.53 sec)

测试链接Navicat

MySQL安装与Navicat连接MySQL报错_Mysql

解决Client does not support authentication protocol requested by server

mysql> alter user 'root'@'localhost' identified with mysql_native_password by '123456';
Query OK, 0 rows affected (0.16 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)

mysql>

再测试链接

MySQL安装与Navicat连接MySQL报错_Mysql_02