啤酒MySQL 8.0.12版本 Sequel Pro连接失败

3

我遇到了和这个问题一模一样的情况。问题在于解决方案在我的情况下并不是很易于理解。

MySQL报错:无法加载认证插件“caching_sha2_password”:dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2):找不到文件

在我的Mac系统偏好设置中没有任何初始化DB的内容。第二个答案说:

  • 转到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]';

  • 用exit退出mysql shell,并运行sudo service mysqld restart

关于如何找到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连接(使用指定的密码)。
多个用户在答案评论中报告第二种解决方案会导致Sequel Pro崩溃,因此我想这是一种欺骗性的方法。
我如何将mysql ver 8.0.12连接到SequelPro?我应该使用另一个GUI吗?似乎工作台也会出现这个问题。
以防万一,我正在使用Mac OSX Sierra 10.13.5。
1个回答

3

以下是我在装有Homebrew的macOS Mojave(10.14.3)上安装MySQL 8时的解决方法:

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';

请将“password”替换为您的mysql服务器根密码。

3)为确保所有更改都被mysql服务器接受,我重新启动了服务器。

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

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接