如何将 MySQL 工作台与 MAMP PRO 连接?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1391182/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to connect MySQL workbench with MAMP PRO?
提问by Chris Hough
What is the fix to connect the MySQL Workbenchtool with the MAMP PROMySQL database?
将MySQL Workbench工具与MAMP PROMySQL 数据库连接的修复方法是什么?
采纳答案by Chris Hough
I was able to get http://www.sequelpro.com/working by pointing it to the socket: /Applications/MAMP/tmp/mysql/mysql.sock
我能够通过将它指向套接字来使http://www.sequelpro.com/工作:/Applications/MAMP/tmp/mysql/mysql.sock
回答by Mike
Change the connection type from TCP/IP
to Local
, then point it to the socket:
将连接类型从 更改TCP/IP
为Local
,然后将其指向套接字:
/Applications/MAMP/tmp/mysql/mysql.sock
/Applications/MAMP/tmp/mysql/mysql.sock
Your username and pw will most likely be root / root
您的用户名和密码很可能是 root / root
回答by elboletaire
As Mikesaid 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):
或者您可以生成一个指向您的 mysql 套接字的符号链接(从您的终端):
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/
Doing it this way the changes will be permanentand you will be able to connect to mysql using the mysqlcli
or any other external tool.
这样做,更改将是永久性的,您将能够使用mysqlcli
或任何其他外部工具连接到 mysql 。
回答by Jonathan
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.
但是,我还发现进入 MySQL 选项卡并检查Allow network access to MySQL
并选择only from this Mac
单选按钮,我可以使用以前保存在 MySQL Workbench 中的连接进行连接,在升级到 MAMP Pro 之前,我一直在使用标准 MAMP。
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.
因此,对于那些从 MAMP 迁移到 MAMP Pro 并且已经在 MySQL Workbench 中设置连接的人来说,此选项比使用 unix 套接字设置新连接更快。
回答by Dmitry Krychylskyy
回答by brunoramonalmeida
回答by J?rn
I had the same problem and fixed it by unchecking the "Allow local access only" checkbox in the Server->MySQL Tab
我遇到了同样的问题,并通过取消选中服务器-> MySQL 选项卡中的“仅允许本地访问”复选框来修复它
回答by here
Make sure MySQL is set to "on" in addition to Apache or nginx. The Servers
button may not toggle all of them.
确保除 Apache 或 nginx 外,MySQL 设置为“on”。该Servers
按钮可能无法全部切换。
In my case, only Apache was running :)
就我而言,只有 Apache 正在运行 :)
回答by Jonas Stensved
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.
如果我使用套接字并在常规选项卡中/Applications/MAMP/tmp/mysql/mysql.sock
设置“以用户身份运行 Apache/MySQL www/mysql
”,我只能连接。
回答by Christopher Jones
If, after following Mike'sanswer 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/mysqlwith /Application/MAMP/Libraryin the fields:
按照此处的说明操作。对我来说,我必须在字段中用/Application/MAMP/Library替换/usr/local/mysql:
- Start MySQL:
- Stop MySQL:
- Check MySQL Status:
- 启动 MySQL:
- 停止 MySQL:
- 检查 MySQL 状态: