我刚刚在 macOS v10.13.4 上使用 Homebrew 安装了 MySQL Ver 14.14 Distrib 5.7.22。
我运行了命令:
brew install mysql
安装完成后,按照 Homebrew 的指示,我运行了命令:
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 文件中的 default_authentication_plugin 更改为 mysql_native_password ,但它仍然引发相同的错误。
接下来我尝试运行:
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.
任何帮助表示赞赏。
所以,我通过以下方式找到了mysqld的运行进程sudo lsof -i tcp:3306
然后我用它杀死了它sudo kill -9 <PID>
.
之后我尝试过mysql_secure_installation
再次出现,但遇到了新错误:
错误:无法通过套接字“/tmp/mysql.sock”连接到本地 MySQL 服务器 (61)
在尝试了一些修复以使 mysql.sock 正常工作后,我启动了 MySQL 服务器sudo mysql.server start
然后继续mysql_secure_installation
为root用户设置密码。
这最终对我有用。
注意:Homebrew 要求您首先执行以下操作mysql_secure_installation
在第一次启动 MySQL 服务器之前,但这只是让我遇到了无限的错误循环。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)