What is the fix to connect the MySQL Workbench tool with the MAMP PRO MySQL database?
12 Answers
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
-
This was precisely what I was looking for! – Lothre1 Nov 02 '13 at 17:34
-
1Wonder why the other answer was selected :) – Ram Feb 22 '14 at 17:08
-
3After I set the above parameters, I received: "Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)" – HuongOrchid Jul 13 '17 at 15:22
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.

- 1
- 1

- 5,180
- 2
- 36
- 46
I was able to get http://www.sequelpro.com/ working by pointing it to the socket: /Applications/MAMP/tmp/mysql/mysql.sock

- 3,389
- 3
- 41
- 80
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.
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.
I had the same problem and fixed it by unchecking the "Allow local access only" checkbox in the Server->MySQL Tab

- 845
- 5
- 16
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.

- 98
- 6
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.

- 14,378
- 5
- 51
- 80
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:

- 1
- 1

- 23
- 4
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.

- 1,211
- 1
- 11
- 19
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 :)

- 2,790
- 25
- 30