一、环境搭建:
-
下载并安装mysql,下载地址:https://dev.mysql.com/downloads/installer/
-
下载并安装客户端连接工具Navicat,下载地址:http://www.formysql.com/xiazai.html
二、解决问题:
首先打开“MySQL 8.0 Command Line Client”这个文件,输入安装mysql时填写的密码;
查看用户信息:
select host,user,plugin,authentication_string from mysql.user;
主要看user是root这一行,host对应的值是localhost,代表的是只供本机使用;plugin的值是caching_sha2_password表示需要修改,
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的新密码';
然后在连接就可以了