Tutorials

Setting up MySQL for PHP Development on a Mac

Step 7: Setting up MySQL for PHP Development on a Mac

Begin Configuration of the MySQL Socket

Picture_13

At this point the MySQL server should be running and you should be able to connect to it using the Workbench tool. PHP, however, will still be unable to connect to the MySQL server because it is looking for its socket in the wrong place.

In order to correct this we need to create a link to the actual socket file from where PHP will look for it.

To do this open the OSX terminal application (under applications/utilities) and run the following command: sudo mkdir /var/mysql

You'll be required to type your password for this command to succeed. When the command is done no output will be shown. As long as you don't see an error then it worked.