mysql错误:无法加载身份验证插件“caching\u sha2\u password”

bnlyeluc  于 2021-06-21  发布在  Mysql
关注(0)|答案(4)|浏览(558)

我刚刚在macosv10.13.4上安装了mysql版本14.14发行版5.7.22和自制软件。
我运行命令: brew install mysql 安装完成后,在自制软件的指导下,我运行了以下命令: mysql_secure_installation 并返回错误: Error: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/Cellar/mysql/5.7.22/lib/plugin/caching_sha2_password.so, 2): image not found 我尝试了一些方法,比如在my.cnf文件中将默认的\u身份验证\u插件更改为mysql\u本机\u密码,但仍然抛出相同的错误。
接下来我试着跑步: mysql_upgrade -u root 我又犯了同样的错误 mysql_upgrade: Got error: 2059: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/Cellar/mysql/5.7.22/lib/plugin/caching_sha2_password.so, 2): image not found while connecting to the MySQL server Upgrade process encountered error and will not continue. 感谢您的帮助。

chhkpiq4

chhkpiq41#

我在sequel pro尝试通过ssh连接到本地安装了mysql的aws ubuntu服务器时遇到了这个错误。
我使用的是一个非root mysql用户,它给了我这个错误。当我用root用户和密码运行它时,它工作了。

mpbci0fu

mpbci0fu2#

重新启动mysql服务器以使更改生效,并尝试通过mysql与任何mysql客户端连接。
否则使用docker

docker run -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d mysql --default-authentication-plugin=mysql_native_password
mysql -uroot --protocol tcp

试穿pwd
提出一个问题。
无法加载身份验证插件“caching\u sha2\u password”

ctehm74n

ctehm74n3#

所以,我找到了mysqld的运行过程 sudo lsof -i tcp:3306 然后我用枪杀了它 sudo kill -9 <PID> .
在这之后我试着 mysql_secure_installation 又一次,但遇到了新的错误:
错误:无法通过套接字'/tmp/mysql.sock'(61)连接到本地mysql服务器
在尝试了一些使mysql.sock正常工作的修复之后,我用 sudo mysql.server start 然后继续 mysql_secure_installation 为根用户设置密码。
我终于成功了。
注:自制要求你先做 mysql_secure_installation 在第一次启动mysql服务器之前,这让我陷入了无尽的错误循环。

55ooxyrt

55ooxyrt4#

我发现这应该是安装mysql版本的问题。如上所述,您应该首先找到然后杀死连接在3306端口上的mysqld进程

sudo lsof -i tcp:3306
sudo kill -9 <Peocess ID>

然后通过brew升级mysql安装,在这种情况下:

brew upgrade mysql

升级后运行mysql应该会在安装后启动服务器。
例如 mysql -u root -p [your password here]

相关问题