« More of the tiered internet: Asinine Comments from AT&T's Whitacre | Main | bbedit vs. textmate (my take) »

One for the search engines: php mysql_connect problems on OS X 10.4

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:

mysql.default_socket =
to
mysql.default_socket = /tmp/mysql.sock

Voila - WordPress is running on my local machine.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)



About

This page contains a single entry from the blog posted on February 6, 2006 1:06 PM.

The previous post in this blog was More of the tiered internet: Asinine Comments from AT&T's Whitacre.

The next post in this blog is bbedit vs. textmate (my take).

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.33