Sequel Pro and MySQL connection failed

I just installed mysql on mac from Homebrew

brew install mysql


mysql -V


mysql  Ver 8.0.11 for osx10.13 on x86_64 (Homebrew)

from terminal it works and I can login to mysql but from Sequel Pro it says

enter image description here

Unable to connect to host 127.0.0.1, or the request timed out.

Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).

MySQL said: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/lib/plugin/caching_sha2_password.so, 2): image not found

can't figure out what I am missing

93889 次浏览

这是因为 Sequel Pro 还没有准备好接受一种新的用户登录,正如错误所说: 没有驱动程序。

mysql + homebrew

基本上,您将不得不手动执行一些操作,但是-您的数据库数据不会像下面的解决方案一样被删除

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

    default-authentication-plugin=mysql_native_password

  • 从终端登录到 mysql 服务器: 运行 mysql -u root -p,然后在 shell 中执行这个命令(用实际的密码替换 [密码]) :

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

  • exit from mysql shell with exit and run brew services restart mysql.

应该可以。

快速修复(破坏性方法)

快速修复非自制安装:

Apple Logo > System Preferences > MySQL > Initialize Database,然后键入您的新密码,并选择’使用遗留密码’

重新启动后,您应该能够连接。仅在新安装时执行此操作,因为否则可能会丢失数据库表。


my.cnf

Cnf 文件位于 Unix/Linux 上的/etc/my.cnf 中


替代品

对于那些仍在与 Sequel Pro 问题作斗争的人来说: Sequel Pro 是一个伟大的产品,但由于大量未解决的问题和上一次发布日期是2016年,也许寻找一些替代品是一个好主意。SequelPro 有一个分支,名叫 SequelAce,看起来非常稳定和最新,它保持了相似的功能,相似的外观和感觉,但同时它没有老的 SequelPro 问题

如果您通过 root@127.0.0.1连接到 MySQL,请确保您也重置了它的密码!

ALTER 用户‘ root’@’127.0.0.1’标识为 mysql _ nate _ password BY’[ password ]’;

  1. 假设您没有 Mysql配置,请将以下内容回显到 ~/.my.conf
[mysqld]
default-authentication-plugin=mysql_native_password
  1. mysql -u root -p进入 Mysql
  2. 使用 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '[PASSWORD]';设置 root 用户密码,其中 [PASSWORD]是您选择的密码。
  3. 用例如 brew services restart mysql重新启动 Mysql

续集专业版从2016年就死了。不要因为一个工具而降低数据库的等级。继续使用其他工具。

2020年更新: 续集专业是正式死亡,但非正式活着!你可以在这里找到不存在这个问题的“ 每晚”构建(即支持 Mysql 8 auth) : < a href = “ https://Sequelpro.com/test-builds”rel = “ norefrer”> https://sequelpro.com/test-builds

2021年更新: 续集 Ace 是一个很好的类似活的替代品: https://github.com/Sequel-Ace/Sequel-Ace#installation(由 Maciej Kwas 的答案提供)


这里的所有其他解决方案都建议更改您正在使用的工具的 DB 设置(使其不那么安全,正如 MySQL 所宣传的那样)。我不能接受。

我一直是 Sequel Pro 的超级粉丝,甚至还捐了钱给它。但是,我所有的激情和爱,我很抱歉,如果该工具没有任何发布 从2016年开始。YOLO 我需要向前看!

The alternative I found (from https://stackoverflow.com/a/55235533/2321594, thanks to @arcseldon) is 海狸 which supports MySQL 8's new authentication (non-legacy) method.

附言。in the tool side, not the DB side的唯一技巧是当您创建一个 MySQL 8连接时,您可能需要转到“ Driver Properties”(稍后可以在 Edit Connection 中找到)并将 allowPublicKeyRetrieval的值转换为 true

I needed this to connect to my MySQL container created using Docker. To have the IP of MySQL be visible to the outside, for any other application in your ecosystem (not just this tool), you should either create a new user in MySQL, or pass -e MYSQL_ROOT_HOST=% in the run-time or as an ENV.

如果有人面临这个问题,并安装 MySQL version > 8通过 .dmg文件; 从官方链接下载。在这种情况下,请使用 本指引。我添加相同的细节以防链接将来不可用。

这个问题是因为你正在使用新的 Strong Password Encryption,这是 MySQL 8的一个新特性,如果你使用 .dmg文件安装 MySQL 8,你可以转到 System Preferences > MySQL,然后点击 Initialize Database键入你的密码并选择第二个选项 Use Legacy Password Encryption

Sequel Pro 已经正式死亡,不再支持更新的 MySql 特性。然而,好消息是它被 续集 A所取代,续集 A可以在 GitHub应用程序商店上使用。该应用程序是免费的,看起来像官方替代续集专业作为 帖子是由 Sequel Pro 的合作者之一制作的

P.我决定张贴这个作为一个答案,因为其他人没有提到,现在有一个最新的替代续集专业

这对我很有用。 如果你得到了这个错误:

无法连接到主机127.0.0.1,或请求超时。

确保地址正确,并且你有必要的 权限,或者尝试增加连接超时(目前为10 秒)。

MySQL 说: 身份验证插件‘ cache _ sha2 _ password’不能 加载: dlopen (/usr/local/lib/plugin/cache _ sha2 _ password. so,2) :

Plz try this solution

enter image description here