如何将 MySQL Workbench 与 MAMP PRO 连接?
将 MySQL Workbench 工具与 MAMP PRO MySQL 数据库?
What is the fix to connect the MySQL Workbench tool with the MAMP PRO MySQL database?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
将连接类型从
TCP/IP
更改为Local
,然后将其指向套接字:/Applications/MAMP/tmp/mysql/mysql.sock
您的用户名和密码很可能是 root / root
Change the connection type from
TCP/IP
toLocal
, then point it to the socket:/Applications/MAMP/tmp/mysql/mysql.sock
Your username and pw will most likely be root / root
正如 Mike 所说,您可以使用 Local 选项并将其指向套接字:
或者您可以生成指向 mysql 的符号链接套接字(从您的终端):
这样做更改将是永久性的,您将能够使用
mysqlcli
或任何其他外部工具连接到mysql。As Mike said you can use the Local option and point it to the socket:
Or you can generate a symbolic link to your mysql socket (from your terminal):
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.我能够通过将 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
环顾了一段时间后,迈克的回答非常有效。
但是,我还发现进入 MySQL 选项卡并选中
允许网络访问 MySQL
并选择仅从此 Mac
单选按钮我能够使用之前保存的连接进行连接在 MySQL Workbench 中,在升级到 MAMP Pro 之前,我一直将其与标准 MAMP 一起使用。因此,对于那些从 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 theonly 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.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.
我遇到了同样的问题,并通过取消选中“服务器”->“MySQL”选项卡中的“仅允许本地访问”复选框来修复它
I had the same problem and fixed it by unchecking the "Allow local access only" checkbox in the Server->MySQL Tab
使用 MAMP 连接到数据库。
您必须使用本地连接
Connection to DB with MAMP.
You must use local connection
就我而言,问题在于端口。 此处也有解释,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.
仅当使用套接字
/Applications/MAMP/tmp/mysql/mysql.sock
并设置“以用户身份运行 Apache/MySQLwww/mysql
时,我才能连接“在常规选项卡中。I'm only able to connect if I use the socket
/Applications/MAMP/tmp/mysql/mysql.sock
AND set "Run Apache/MySQL as userwww/mysql
" in the gerneral tab.如果按照Mike的回答后您收到:
按照说明操作这里。对我来说,我必须在以下字段中将 /usr/local/mysql 替换为 /Application/MAMP/Library:
If, after following Mike's answer you receive:
Follow the instructions here. For me, I had to replace /usr/local/mysql with /Application/MAMP/Library in the fields:
当我必须建立此连接时,我将 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.
除了 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 :)
MAMP 服务器通常使用 8889 端口而不是 3306。您可以在 MAMP/SQL 部分查看它。
MAMP server typically uses 8889 port instead of 3306. You can check it in MAMP/SQL section.