解决登录mysql时报错: Authentication plugin ‘caching_sha2_password‘ cannot be loaded
·
报错信息如下:
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /www/server/mysql/lib/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
首先大家可能都知道了:
- mysql5 默认加密方式是 my_native_password
- mysql8 默认加密方式是 caching_sha2_password
这个问题就是使用了caching_sha2_password加密方式却找不到某个必需的文件
网上的大部分解决方法方法都是千篇一律:
先进入mysql, 然后修改mysql默认的加密方式为mysql_native_password
也就是下面两行命令:
use mysql; # 选择数据库mysql
update user set plugin='mysql_native_password'; # 修改加密方式
或者下面两行(和上面相同的效果)
use mysql;
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY '111111';
但问题是根本进不去mysql啊, 我怎么修改表啊......
所以还有下面两种方法:
第一种方法(可能失效):
编辑my.cnf配置文件
vim /etc/my.cnf
在[mysqld]下面加上一行:
default_authentication_plugin=mysql_native_password
这个意思是改变默认加密方式
第二种方法(绝杀):
编辑my.cnf配置文件
vim /etc/my.cnf
在[mysqld]下面加上一行:
skip-grant-tables
这个意思是跳过密码验证(这招够毒啊)
----------------------------------------------------------------------
最后终于好了呜呜呜.....
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)