Tag Archive: macports


uninstall inactive!

Oh man I just realized that I never ran “sudo port uninstall inactive” and I have reclaimed… hmm… 5 gigs? It’s as simple as that – if you’re using macports for a while and you’ve been using “sudo port upgrade outdated” to upgrade, make sure you remove the old versions because after a while that space really adds up! I don’t know why I thought that upgrading a port removed the old version? I bet it’s in the documentation somewhere (yes, it’s time for me to RTFM haha)

I just noticed that when you use the mysql 5 client from MacPorts (installed as /opt/local/bin/mysql5) to connect to a mysql5 server running on localhost that was installed via the package at dev.mysql.com, an error is generated:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/opt/local/var/run/mysql5/mysqld.sock’ (2)

This is because the installation of mysql 5 server from the mysql site uses /tmp to hold the socket file. Of course if you read the README you’d know this:

“The installation layout is similar to that of a `tar’ file binary
distribution; all MySQL binaries are located in the directory
`/usr/local/mysql/bin’. The MySQL socket file is created as
`/tmp/mysql.sock’ by default.”

I, of course, did not read the README first, and so I wondered what I was doing wrong. The fix is easy, just add

-S /tmp/mysql.sock

to your mysql5 command to use it without any configuration (i.e. changing the location of the socket).

Wordpress Cloud Hosting