Drupal 7 and MySQL sockets

I recently switched from a mysql.com implementation of MySQL to MacPorts on my local, and the Drupal sites would no longer load.

The MacPorts my.cnf file turns off networking, so that multiple versions of MySQL can be run. In doing so, one must then use socket files to access MySQL instead of TCP/IP. This requires a change to the database config in the settings.php file.

Simply add the path to your socket file as an additional line in the database config array, as follows:

'unix_socket' => '/<path>/mysqld.sock'

replacing <path> with the path on your system. On mine, it's:

/opt/local/var/run/mysql55/mysqld.sock

Of course, the Drupal Community isn't the only place to give back. It's a complex world, and there are as many worthy causes as their are melodies, with most being served by multiple charitable organizations. Here are a few of those that strike a 7th chord with me.