Mac OSX Web Development

Xampp MySQL Server Doesn’t Start in OSX Yosemite – Solve Mysqld Error in OSX

I was trying to install WordPress on my local xampp server, because I wanted to develop some plugin. But unfortunately whenever I tried to connect the MySQL Server of xampp it always ended up with error. After a lot of tries I wasn’t able to run MySQL on my localhost xampp server over my laptop.

I first thought that there might be a port error, like sometimes the port over which the required service tries to run has already been occupied by another application, to solve this, I just tried to configure another port through the xampp manager. Which Seems like this:

This picture I took after successfully resolving the MySQL Error of Xampp in Yosemite

This picture I took after successfully resolving the MySQL Error of Xampp in Yosemite

No matter what I tried, the MySQL Server of xampp was not willing to start and this was just wasting a lot of my precious time. I thought to find a solution for this problem and finally I found a working solution to solve this mysqld service issue in xampp.

Solve mysqld error in xampp while running it on OSX Yosemite:

1) Just fire up your search bar, the keyboard shortcut to run search bar on OSX is command+space bar. There write:

/Applications/XAMPP/xamppfiles/

press enter and this will take you to a folder.

2) Find xampp (A unix executable file), right click on the file and edit it using some code editors.

3) Find the following piece of code in that file:

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

 4) Add following piece of code, just above the code written in instruction 3)

unset DYLD_LIBRARY_PATH

5) So your file will now look like this:

edit_xampp_to_start_mysqld_error_mac_osx

Finally I Solved the Error in MySQL over Xampp:

After pressing ctrl+s after adding the unset line, as shown in above instructions I was able to run xampp over my Mac, and without adding this line I wasn’t able to run a mysql server and do my usual web development tasks. Since for a developer, having PHP and MySQL installed over laptop is much essential. Hope this solution or workaround to solve the MySQL issue in xampp will help other developers and is going to save their time.

You must try changing the port too, before applying the above mentioned change, because most of the time the port over which mysql service tries to run has already been occupied by other program, like in most cases skype is the culprit.

2 Comments

  • 4) Add following piece of code, just above the code written in instruction 3)

    unset DYLD_LIBRARY_PATH

    is now implemented in XAMPP.

    I found this way to solve the problem:

    1) Install XAMPP as known
    2) Configure & upgrade all databases (phpmyadmin etc.)
    3) For further installations as Joomla etc. change the “rights” for the Original htdocs-Folder ONLY

    Since this Mysql works fine to me