如何将 MySQL Workbench 与 MAMP PRO 连接?

发布于 2024-08-04 12:39:32 字数 202 浏览 3 评论 0原文

MySQL Workbench 工具与 MAMP PRO MySQL 数据库?

What is the fix to connect the MySQL Workbench tool with the MAMP PRO MySQL database?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

美羊羊 2024-08-11 12:39:32

将连接类型从 TCP/IP 更改为 Local,然后将其指向套接字:

/Applications/MAMP/tmp/mysql/mysql.sock

您的用户名和密码很可能是 root / root

Change the connection type from TCP/IP to Local, then point it to the socket:

/Applications/MAMP/tmp/mysql/mysql.sock

Your username and pw will most likely be root / root

浊酒尽余欢 2024-08-11 12:39:32

正如 Mike 所说,您可以使用 Local 选项并将其指向套接字:

/Applications/MAMP/tmp/mysql/mysql.sock

或者您可以生成指向 mysql 的符号链接套接字(从您的终端):

sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/

这样做更改将是永久性的,您将能够使用mysqlcli或任何其他外部工具连接到mysql。

As Mike said you can use the Local option and point it to the socket:

/Applications/MAMP/tmp/mysql/mysql.sock

Or you can generate a symbolic link to your mysql socket (from your terminal):

sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/

Doing it this way the changes will be permanent and you will be able to connect to mysql using the mysqlcli or any other external tool.

聊慰 2024-08-11 12:39:32

我能够通过将 http://www.sequelpro.com/ 指向套接字来使其工作:/应用程序/MAMP/tmp/mysql/mysql.sock

I was able to get http://www.sequelpro.com/ working by pointing it to the socket: /Applications/MAMP/tmp/mysql/mysql.sock

风追烟花雨 2024-08-11 12:39:32

环顾了一段时间后,迈克的回答非常有效。

但是,我还发现进入 MySQL 选项卡并选中允许网络访问 MySQL 并选择仅从此 Mac 单选按钮我能够使用之前保存的连接进行连接在 MySQL Workbench 中,在升级到 MAMP Pro 之前,我一直将其与标准 MAMP 一起使用。

MAMP Pro用于允许本地网络访问的 MySQL 设置

因此,对于那些从 MAMP 迁移到 MAMP Pro 并已在 MySQL Workbench 中设置连接的人来说,此选项比使用 unix 套接字设置新连接更快。

After looking around for quite some time, Mike's answer worked great.

However, I also discovered that going into MySQL tab and checking Allow network access to MySQL and choosing the only from this Mac radio button I was able to connect using the previously saved connection in MySQL Workbench that I had been using with standard MAMP before upgrading to MAMP Pro.

MAMP Pro MySQL settings for allowing local network access

So for those of you who are moving from MAMP to MAMP Pro and already have your connections setup in MySQL Workbench, this option is quicker than setting up a new connection using a unix socket.

沦落红尘 2024-08-11 12:39:32

我遇到了同样的问题,并通过取消选中“服务器”->“MySQL”选项卡中的“仅允许本地访问”复选框来修复它

I had the same problem and fixed it by unchecking the "Allow local access only" checkbox in the Server->MySQL Tab

终难愈 2024-08-11 12:39:32

连接至使用 MAMP 的数据库

使用 MAMP 连接到数据库。
您必须使用本地连接

CONNECTION TO DB with MAMP

Connection to DB with MAMP.
You must use local connection

悟红尘 2024-08-11 12:39:32

就我而言,问题在于端口。 此处也有解释,MAMP 中的默认 mysql 端口是 8889,而不是 3306,尽管在 MAMP localhost 网站中说它在 3306 中运行。

In my case the problem was the ports. As well explained here, the default mysql port in MAMP is 8889, and not 3306, although in MAMP localhost website says that it`s running in 3306.

狼亦尘 2024-08-11 12:39:32

仅当使用套接字 /Applications/MAMP/tmp/mysql/mysql.sock 并设置“以用户身份运行 Apache/MySQL www/mysql 时,我才能连接“在常规选项卡中。

I'm only able to connect if I use the socket /Applications/MAMP/tmp/mysql/mysql.sock AND set "Run Apache/MySQL as user www/mysql" in the gerneral tab.

苯莒 2024-08-11 12:39:32

如果按照Mike的回答后您收到:

Operation failed: /usr/local/mysql/support-files/mysql.server start is invalid

按照说明操作这里。对我来说,我必须在以下字段中将 /usr/local/mysql 替换为 /Application/MAMP/Library

  • 启动 MySQL:
  • 停止 MySQL:
  • 检查 MySQL 状态:

If, after following Mike's answer you receive:

Operation failed: /usr/local/mysql/support-files/mysql.server start is invalid

Follow the instructions here. For me, I had to replace /usr/local/mysql with /Application/MAMP/Library in the fields:

  • Start MySQL:
  • Stop MySQL:
  • Check MySQL Status:
江湖彼岸 2024-08-11 12:39:32

当我必须建立此连接时,我将 TCP/IP 连接设置为套接字,并将 UN/pw 设置为 root,正如 Mike 上面建议的那样。然而,工作台仍然告诉我它正在这个位置(/etc/my.cnf)寻找 cnf 文件。

我创建了一个从 MAMP cnf 文件到 Workbench 正在寻找它的位置的符号链接。
(sudo ln -s /Applications/MAMP/Library/support-files/my.cnf /etc/my.cnf)

设置完成,没有问题。

When I have to make this connection, I set my TCP/IP connection to socket and UN/pw both to root as Mike suggests above. However workbench was still telling me that it was looking for a cnf file at this location (/etc/my.cnf).

I created a symlink from my MAMP cnf file to the location that Workbench was looking for it.
(sudo ln -s /Applications/MAMP/Library/support-files/my.cnf /etc/my.cnf)

setup finalized without issue.

乱了心跳 2024-08-11 12:39:32

除了 Apache 或 nginx 之外,请确保 MySQL 设置为“on”。 Servers 按钮可能无法切换所有服务器。

就我而言,只有 Apache 正在运行:)

Make sure MySQL is set to "on" in addition to Apache or nginx. The Servers button may not toggle all of them.

In my case, only Apache was running :)

为人所爱 2024-08-11 12:39:32

MAMP 服务器通常使用 8889 端口而不是 3306。您可以在 MAMP/SQL 部分查看它。在此处输入图像描述

MAMP server typically uses 8889 port instead of 3306. You can check it in MAMP/SQL section.enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文