WordPress on Mac

I’ve been banging my head against the wall for the past day, trying to figure out why my wordpress install on my Mac doesn’t talk to the database. Setup is simple, enable the built-in apache web server, install the Mac Mysql server and setup as per the wordpress instructions.
. But

When you’re on Linux or any other platform I’ve worked on, one specifies the hostname in wp-config.php as ‘localhost’, or whatever hostname the DB is running on.

Seems that when you’re on Mac, you specify the hostname as ‘localhost:/tmp/mysql.sock’. This is not documented anywhere, but works like magic. Hope this saves someone else a headache in the future.

Comments are closed.