
错误原因是:mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password
我的mysql是8.0的用的caching_sha2_password加密方式,navicat版本不支持
解决办法:要么用新版本的navicat,要么把mysql的加密规则改成mysql_native_password
cmd进入MySQL的bin目录

要正确拼写路径
输入mysql -u root -p
,输入密码

设置加密方式为mysql_native_password并更改密码
密码自己设置一下,我一向为了好记就设为admin123了,哈哈
1 | ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'admin123'; |

刷新
1 | FLUSH PRIVILEGES; |

重新连接测试成功
