解决Navicat无法连接MySQL8.0

您所在的位置:网站首页 navicat怎么连接不上数据库 解决Navicat无法连接MySQL8.0

解决Navicat无法连接MySQL8.0

2024-07-16 07:03| 来源: 网络整理| 查看: 265

出错原因

MySQL8.0与MySQL5.0所采用的加密方式规则不一样,所以导致Navicat打不开。 MySQL8.0的root用户的加密规则默认的是: caching_sha2_password,

解决方法

可通过select host,user,authentication_string,plugin from mysql.user;查看密码的规则。 所以我们只需要将默认的caching_sha2_password改为mysql_native_password即可。

select host,user,authentication_string,plugin from mysql.user; 第一步登录mysql mysql -u root -p

在输入密码

提示没有mysql命令的,是没有配置mysql环境,找到mysql server下的bin目录下输入cmd 在这里插入图片描述 在这里插入图片描述

第二步 将root的 caching_sha2_password解密方式改为mysql_native_password ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码'; 第三步 刷新权限 FLUSH PRIVILEGES;

再次输入select host,user,authentication_string,plugin from mysql.user; 在这里插入图片描述 可以看到root的plugin变成了mysql_native_password

回到Navicat重新连接即可登录



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3