mysql8并解决caching_sha2_password问题客户端登陆时提示:Authenticationplugin'caching_sha2_pass
(2020-06-06 10:46:59)分类: 数据库类文章 |
客户端登陆时提示:
Authentication plugin 'caching_sha2_password' cannot be
loaded:
dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2):
image not found
说明客户端不支持这种加密方式,因为默认生成的root的密码是用 caching_sha2_password
插件加密的。而客户端找不到 caching_sha2_password 插件,于是登录不上。
我们先通过终端输入:mysql -u root -p登录mysql,然后mysql>use mysql
删除原来账号:
drop user 'test'@'%';
创建新账号:
CREATE USER 'test'@'%' IDENTIFIED WITH mysql_native_password
BY '12345678'(按照配置的安全等级来,我配置的0,所以只要满足8位以上就可以了);
grant all on . to test@'%'; 需要给test帐号授权,否则test帐号没任何权限。
以上操作完之后,客户端就可以登录mysql了。