将mysql版本升到8以后,使用较早版本navicat工具连接mysql会出现报错Authentication plugin ‘caching_sha2_password’ cannot be loaded,因为mysql8之后密码插件的问题,需要更新密码为native,或者更新navicat版本。

更新密码为native挺方便,连接数据库执行个sql就好了

1
2
3
4
5
6
# 新建的用户指定密码校验方式
create user 'testuser'@'%' identified WITH mysql_native_password BY 'testpassword';
grant all PRIVILEGES on *.* to 'testuser'@'%'

# 更新已有的用户密码校验方式
ALTER USER 'testuser'@'%' IDENTIFIED WITH mysql_native_password BY 'testpassword';