MySQL socket port on Mac OS X

Every time I reinstall my system software, or set up a new machine, I break phpMyAdmin’s socket connection. Recently, information in this post helped me sort it out.

First, find out where MySQL is putting its socket:

> /usr/local/mysql/bin/mysqladmin variables
| socket     | /tmp/mysql.sock|

And then point phpMyAdmin to it by changing these lines in the file:

$cfg['Servers'][$i]['socket']   = '/tmp/mysql.sock';
$cfg['Servers'][$i]['connect_type']  = 'socket';

You might also (or instead) need to create a link from where MySQL has its socket to the location in which PHP thinks the socket should be:

>sudo ln -h /tmp/mysql.sock /var/mysql/mysql.sock

Finding your MAN

For some reason, my Mac OS X 10.8.2 installation keeps forgetting where my MAN pages are:

>man launchctl
No manual entry for launchctl
>echo $MANPATH

Apparently they’re in /usr/share/man, so we can append this proper path to the existing path with:

>export MANPATH=$MANPATH:/usr/share/man

>echo $MANPATH