Please direct all future questions to
MAMP PRO customers can direct their questions to
Bitte posten Sie ab jetzt Ihre Fragen bei
Unseren Support für MAMP PRO erreichen Sie unter

MySQL failing to connect on two Macs...same error

Report any found bug here. We are grateful for any useful clues.

Moderator: severin

MySQL failing to connect on two Macs...same error

Postby Deano » Wed Nov 16, 2011 6:58 am

(NOTE: Tried posting this problem couple days ago, but it never showed up).
I have an iMac and a Black MacBook, both running OS X 10.6.8, and the MySQL in my MAMP installations stopped connecting at about the same time at least a month ago. (Didn't need a fix immediately so procrastinated looking for one. Now, I need one, and haven't found a solution in the forum posting.

Both MAMP/MySQL failures generate the same console error message. (see below). On the iMac, MAMP is 2.0.2 (upgraded from 1.9.6, i believe, as one effort to solve the problem), and MAMP is 1.9.x on the MacBook.

The console error message on both machines is:
11/7/11 5:26:59 PM [0x0-0x2c02c].de.appsolute.MAMP[272] 111107 17:26:59 mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error_log.err'.
11/7/11 5:26:59 PM [0x0-0x2c02c].de.appsolute.MAMP[272] chown: /Applications/MAMP/logs/mysql_error_log.err: Operation not permitted
11/7/11 5:26:59 PM [0x0-0x2c02c].de.appsolute.MAMP[272] 111107 17:26:59 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql
11/7/11 5:27:04 PM [0x0-0x2c02c].de.appsolute.MAMP[272] 111107 17:27:04 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/ ended

One forum posting referenced a file at: MAMP/bin/mamp/index.php which includes the following two lines of code:
$port = '3306';
$link = @mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'root');

Two observations: MySQL port is set to 8889, but changing the port to 3306 or the link in the file to 8889, doesn't fix the problem.
Second, there is no "mysql.sock" file in ':/Applications/MAMP/tmp/mysql/mysql.sock'

Could this be part of the problem?

Also, why would the MySQL stop working on two different macs about the same time? and generate the same error?

Posts: 4
Joined: Tue Nov 08, 2011 2:53 am

Re: MySQL failing to connect on two Macs...same error

Postby Deano » Sat Nov 26, 2011 4:59 am

After struggling through many of the solutions posted that worked for other people, and after a clean install of MAMP, I was finally able to solve the problem on the iMac, and I figure this will work on the MacBook as well. I'm copying and pasting here, because it's multiple steps and you need to be modestly confident in your Terminal chops.

One note: In the last step, I had to use sudo in front of: cp /Applications/MAMP/my.cnf /etc/my.cnf in order to bypass a permissions issue when I tried copying the my.cnf file back to the etc directory.

However, all these steps lead to a solution and thanks to tstermitz...

Beginning quote from another forum post:

Answers to some of the questions...

Mysqld won't start
Preferences won't open

(0) Close down Apache and Mysql

(1) You may have dangling httpd or mysqld process:

ps aux | grep mysqld
ps aux | grep httpd

(2) my.cnf resides in /etc , a directory that is normally hidden from users. You can access it via a terminal window, Terminal (in /Applications/Utilities) or iTerm, or other. (I can edit this file in the terminal, but I'm an old Unix guy). It's easy to copy my.cnf to somewhere convenient to edit, such as my MAMP directory, edit it, save it, then copy back in terminal:

cp /etc/my.cnf /Applications/MAMP/my.cnf
cp /Applications/MAMP/my.cnf /etc/my.cnf

(3) You may have to delete old plist files, which will be recreated by MAMP.


Now, you should be able to restart MAMP, hit the Mamp Preferences button....

(4) Ooops, maybe you haven't changed mysql port to 3306, so change it in MAMP Preferences

Go back to (0).
Posts: 1
Joined: Mon May 02, 2011 12:52 am
Posts: 4
Joined: Tue Nov 08, 2011 2:53 am

Re: MySQL failing to connect on two Macs...same error

Postby AngusHume » Tue Jan 10, 2012 2:11 am

I just came across this post, had the same issue but on reading the above solution I decided to check for stray MySQL processes in Activity monitor first. Sure enough there was a bunch in there, and each time I tried launching MAMP again it failed to launch MySQL again and added yet another active process. I just quit them all and relaunched MAMP and everything started fine.
Posts: 1
Joined: Tue Jan 10, 2012 2:06 am

Return to Bugs

Who is online

Users browsing this forum: No registered users and 5 guests