This is one for me and the search engines. I feverishly worked on getting WordPress up and running on my PowerBook to test for a new website I'm working on. (Actually, I started with typo, but that's another story.) I'm not bragging, but I can set up website that use PAM (php, apache & mysql) blindfolded. Back when MySQL didn't provide a binary installer for MySQL on OS X, it was a bit more difficult, but these days, everything is easy as cake - or so I thought. The binary installer for MySQL sets the socket location to a different place than PHP is expecting. Hence, when I tried to load the new database backend for WordPress, I constantly got errors that my configuration file (wp-config.php) was not giving the program correct settings to reach the MySQL database. Then began the frustrating experience of loading, reloading, reconfiguring httpd.conf and many other gestures that resulted in nothing but two hours of my time being wasted.
Lo and behold, the answer was hidden in a Drupal forum: the socket for MySQL on OS X is at /tmp/mysql.sock, not /var/mysql/. Dammit. Open up and edit php.ini (or copy php.ini.default to php.ini and edit) in /private/etc (can someone please tell the Apple people to start using BSD similar locations for config files?) and change:
to
mysql.default_socket = /tmp/mysql.sock
Voila - WordPress is running on my local machine.