How to set up Apache, PHP & MySQL on Mac OS X 10.11 El Capitan & OS X 10.10 Yosemite
Danilo Stern-Sapad

Sorry to disapoint, but I followed all the …

Put this text at the top of the document to set the path to MySQL:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

Save and close php.ini.

Then type:

source ~/.bash_profile

Now from the MySQL preference pane in System Preferences click Start MySQL Server.

This last step isn’t necessary for a dev environment but if you want to easily secure MySQL execute this command in Terminal:


steps and those before, and the MySQL server doesn’t even appear on the System Preferences nor in the Application folder. My computer is pretty recent and I am running El Capitan.

Issuing the command line


and providing root password gives me

MacBook-Pro:apache2 luizcosta$ mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:

Error: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

For what’s worse, from my recollection, this is the first time I “install” something on the Mac that I have to Install (*.pkg file) using an *.dmg every single time I need to work with it.

Like what you read? Give luizcosta a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.