20

[EDIT] The last version of MAMP with the last version of OSX Yosemite works fine.

I installed the beta of Yosemite two month ago, no problem with MAMP. With the last release of OSX, Apache and MySQL did not work.

I found a solution for Apache by using the default port 80 and renaming the file envvars to _envvars in Applications/MAMP/Library/bin but have not been able to solve the problem with MySQL.

0

15 Answers 15

59

Per the Knowledge Base at MAMP for "Apache will not start - Yosemite Beta":

Rename the file envvars located in /Applications/MAMP/Library/bin into _envvars

3
  • This worked for my MAMP PRO on Yosemitee. No need to re-install.
    – asiby
    Commented Oct 19, 2014 at 22:44
  • OP was mentioning mySQL not apache
    – elliotrock
    Commented Nov 11, 2014 at 9:32
  • Worked! This was a life-saver today! Thanks so much :-)
    – mpemburn
    Commented Dec 18, 2014 at 11:06
13

You can also try this workaround posted at http://community.bitnami.com/t/mysqld-doesnt-start-in-mac-os-yosemite/25153

/Applications/XAMPP/xamppfiles/xampp

Look for:

$XAMPP_ROOT/bin/mysql.server start > /dev/null &

And add unset DYLD_LIBRARY_PATH on top of it. It should look like:

unset DYLD_LIBRARY_PATH
$XAMPP_ROOT/bin/mysql.server start > /dev/null &

I hope it helps

10

On MAMP, I was able to get MySQL to work by editing /Applications/MAMP/bin/startMysql.sh and unsetting DYLD_LIBRARY_PATH. So the updated script looks like this:

# /bin/sh
unset DYLD_LIBRARY_PATH
/Applications/MAMP/Library/bin/mysqld_safe... etc.      

It also required killing all MySQL processes previously started by MAMP.

3
  • 1
    This one is exactly what I need. It works after I restart the Mac.
    – Tim Yao
    Commented Nov 5, 2014 at 23:25
  • 2
    if this isn't working straight away it's probably because mysqld has started "badly". Open Activity Monitor and force quit it. Then try clicking "start servers" in MAMP and it should work after a few seconds. test it at localhost:8888/MAMP (default mamp start page). If MySQL is NOT working it will give you a connection error on that page. If it is working the page will load properly and you will get a MAMP/tmp/mysql/mysql.pid file.
    – DynamicDan
    Commented Dec 20, 2014 at 8:36
  • Nice one Sergey. This fix worked immediately when I clicked "Start Servers" on the MAMP control panel.
    – user3799524
    Commented Apr 13, 2015 at 10:01
6

Had same issue today (running last version of Yosemite preview), Apache of XAMPP for OSX didn't work / start. Apache's log files contained no errors.

Finally I've solved this issue by removing XAMPP for OSX and installing latest version of AMPPS (http://www.ampps.com/downloads).

I don't know what's the different or what's the initial problem causing this behaviour - but with AMPPS everything just runs fine.

Hopefully this will work also for you.

2
  • Do you have a tip to do not recreate each database ? Commented Aug 16, 2014 at 17:49
  • If your initial instance of mysql is still running, connect with terminal client or for examle a tool like Sequel Pro (sequelpro.com) to it and export / dump your databases - so you can import them in your new mysql server.
    – ihkawiss
    Commented Aug 16, 2014 at 18:25
4

This solved my problem with mysqld and apache on XAMPP:

As you can see, Yosemite DP 5 changes a few things in its library. Probably if you’re running XAMPP server on DP5 it won’t start mysqld (MySQL database daemon).

What you should do?.

STEP 1 . Download Homebrew. Open your terminal and then type: . . . ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

STEP 2: . Download LIBICONV, you have to type the following lines at terminal: . . . brew install libiconv . . . brew link libiconv —force

STEP 3 . Download SQLITE3, you have to type the following lines at terminal: . . . brew install sqlite3 . . . brew link sqlite3 —force

STEP 4 . Go to Applications/XAMPP/xamppfiles/lib and then delete the following files (remember to empty your trash). . . . libsqlite3.dylib (it is an ALIAS) . . . libsqlite3.0.8.6.dylib . . . libiconv.2.dylib . . . libiconv (it is an ALIAS).

STEP 5 .Restart you “manager-osx.app” then try to turn on your mysql database.

Via: http://exequielplaza.com/funstuff/xampp-dp5-yosemite-mysqlfix.html

3
  • I already seen this solution but I'm using MAMP and not XAMPP. Commented Aug 16, 2014 at 9:03
  • Yosemite killed my XAMPP and this fixed it! Just so nobody is confused, the libiconv.dylib, not libiconv.la is the last file to delete.
    – aris
    Commented Oct 17, 2014 at 20:56
  • I've been wrestling with this issue for a long time. Thank you sir, worked for me! Commented Oct 17, 2014 at 22:58
3

OP question was about MAMP.

I had this issue after installing OSX Yosemite and fixing the envvars to _envvars in the bin/apache2/bin folder.

Then I was getting this socket error. So I checked the error logs for mysql and noticed this:

InnoDB: Unable to lock ./ibdata1, error: 35 InnoDB: Check that you do not already have another mysqld process

gee I love error logs.

I found the process mysqld in Activity Monitor and killed it. Restarted MAMP and bingo! It all seems to hook up now!

1

I have resolved the situation by changing the default Port of Apache 2.4 updated after upgrading to MAC OS Yosemite.

The file is located in: /etc/apache2/httpd.conf

Change Listen 80 to Listen 8080

Restart your MAC, and try to launch again MAMP Services.

1
  • Works with XAMPP for me!
    – Esger
    Commented Nov 10, 2014 at 12:04
0

I fixed this by uninstalling XAMMP and reinstalling. If you go with this approach make sure to back up any content you may have saved in the XAMPP folder.

0
0

I am also running into the same problem with MAMP. Absolutely clueless but with the other responses pointing toward a recent update in OSX I can believe that the problem stems from here. Uninstalled and reinstalled MAMP and MySQL is the only operation able to run...Apache still hangs. Will be downloading AMPPS to see if this corrects things.

1
  • 1
    Check my answer above Stephen. Nice wedding shot btw!
    – elliotrock
    Commented Nov 11, 2014 at 9:32
0

I still needed to use envars so I was able to work around this by removing the following from the file. Found some errors when launching through terminal related to this

if test "x$DYLD_LIBRARY_PATH" != "x" ; then
  DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
else
  DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib"
fi
export DYLD_LIBRARY_PATH
0

I have had the same issue and none of the above worked.

The Apache server in MAMP wouldn't work on port 80, or 8080 (The default Apache ports). The issue is with Apache being enabled by default in Yosemite.

Either: change the Apache port in MAMP (Not preferable if you want to use the default port), or unload the launch Daemon by typing the following into the terminal:

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

2
  • It's weird because when I installed AMPPS it works perfectly with the default port without the need to unload apache from Yosemite. I think it's rather a MAMP issue. Commented Oct 29, 2014 at 8:32
  • I've never used AMPPS, but could it possibly make use of the pre-installed OS X Apache server? MAMP has it's own copy of Apache which comes into conflict with the pre-installed one. Really, the people at MAMP should make allowances for this. If it's as simple as resetting a few files on installation. Commented Oct 29, 2014 at 15:49
0

Edit the below file, with this command on Terminal.app:

sudo vim /Applications/XAMPP/xamppfiles/mysql/scripts/ctl.sh

On line #59, delete this:

/Applications/XAMPP/xamppfiles/xampp startmysql > /dev/null &

and put this

/Applications/XAMPP/xamppfiles/bin/mysql.server start > /dev/null &

(save the file: ESC :wq!)

Restart All Servers on XAMPP.app (manager-osx)

2
  • @Lolloz89 Only for OSx Yosemite and XAMPP 1.8.3-5 Commented Nov 3, 2014 at 14:31
  • Worked for me too! Nice easy solution.
    – innerurge1
    Commented Jun 9, 2015 at 20:22
0

Just to add to this thread, for those running Bitnami MAMP I had the same issue when upgrading to Yosemite (Mampstack-5.4.28-0). I solved it by going to

Applications/Mampstack-(your version)/mysql/scripts/ctl.sh

and adding the following

MYSQL_PIDFILE = ....

unset DYLD_LIBRARY_PATH <==== Add this

MYSQL_START = ....

MYSQL spun like silk. Hope this helps someone with the same problem.

0

I've found this video. This works for me.

Go to MAMP in Applications

then, bin > apache2 > bin and rename 'envvars' to '_envvars'

https://www.youtube.com/watch?v=brpKAM2WXhk

0

Above solutions didn't work for me as I had no conflicting mysqld instances running. After check the mysql error logs in MAMP, it was obvious msqld was having all sorts of issues starting. The main error was:

[ERROR] /Applications/MAMP/Library/bin/mysqld: unknown option '--//skip-networking'

Which pointed me to an option in my.conf file. Somewhere along the line with debugging another issue I had added:

//skip-networking

As an option or I had commented it out. Removing that line allowed mysql in MAMP to start correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.