44

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Chris Hough
  • 3,389
  • 3
  • 41
  • 80

12 Answers12

85

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

spassas
  • 4,778
  • 2
  • 31
  • 39
Mike
  • 871
  • 1
  • 7
  • 6
23

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.

Community
  • 1
  • 1
elboletaire
  • 5,180
  • 2
  • 36
  • 46
10

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

Chris Hough
  • 3,389
  • 3
  • 41
  • 80
9

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.

coletrain
  • 2,809
  • 35
  • 43
Jonathan
  • 323
  • 2
  • 11
2

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

Jörn
  • 845
  • 5
  • 16
2

CONNECTION TO DB with MAMP

Connection to DB with MAMP. You must use local connection

2

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.

0

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.

Jonas Stensved
  • 14,378
  • 5
  • 51
  • 80
0

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:
Community
  • 1
  • 1
0

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.

StephanieF
  • 1,211
  • 1
  • 11
  • 19
0

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 :)

here
  • 2,790
  • 25
  • 30
0

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

Tariq Kamal
  • 468
  • 1
  • 8
  • 17