Brew MySQL 版本 8.0.12 Sequel Pro 连接失败



我遇到了与这个问题完全相同的问题。问题是,在我的情况下,解决方案并没有真正组织起来易于理解。

MySQL 说:无法加载身份验证插件 'caching_sha2_password':dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2(:找不到图像

我没有任何东西可以在macs系统偏好设置中初始化数据库。第二个答案说:

  • 转到 my.cnf 文件,然后在 [mysqld] 部分添加行:

    default-authentication-plugin=mysql_native_password

  • 从终端登录到 mysql 服务器:run mysql -u root -p,然后在 shell 中执行以下命令:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '[password]';

  • 退出 MySQL 外壳并运行 sudo 服务 MySQL 重启

关于在哪里可以找到my.cnf的信息可以在这篇文章中找到,并指出:

mysql --help

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf 
The following groups are read: mysql client
The following options may be given as the first argument:
--print-defaults        Print the program argument list and exit.
--no-defaults           Don't read default options from any option file.
--defaults-file=#       Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.

看起来my.cnf文件有三个区域,我不知道要编辑什么,或者我应该如何编辑它。

我找到的另一个解决方案来自此线程:

安装 MySQL 后,使用 CLI 进行身份验证,例如

mysql -uroot

然后运行以下命令以使用旧的身份验证方法:

ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY 'PASSWORD';

最后,刷新权限:

FLUSH PRIVILEGES;

现在您应该能够再次使用SequelPro进行连接(使用指定的密码(。

据报道,第二种解决方案会导致续集专业版在答案评论中被多个用户崩溃,所以我猜这是黑客

。如何将 mysql 版本 8.0.12 连接到续集专业版?我应该只使用另一个 GUI 吗?似乎这个问题也发生在工作台上

以防万一有人问我正在使用Mac OSX Sierra 10.13.5

以下是在安装了 mysql 8 的 macOS Mojave (10.14.3( 上对我有用的方法。

1( 将此行添加到位于/usr/local/etc 中的 my.cnf 中

default-authentication-plugin=mysql_native_password

2( 以 root 用户身份在命令行上连接到正在运行的 mysql 服务器,然后输入:

ALTER USER 'root'@'localhost'
IDENTIFIED WITH mysql_native_password
BY 'password';

将"密码"替换为MySQL服务器的root密码。

3(只是为了确保所有更改都被mysql服务器拾取,我重新启动了服务器。

这些说明取自 mysql.com 文档,您可以在此处找到:

https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password-compatible-connectors

最新更新