The Pug Automatic

MacPorts gotchas: staging ncurses, running mysql5

Written December 12, 2008. Tagged OS X, SQL, Git.

Got my computer back from repairs. I'm reinstalling most things instead of just restoring from backup, to get rid of some cruft.

Ran into some gotchas when installing from MacPorts that I thought I'd blog here for my own future reference and for others. This stuff is on Google, but can be hard to find.

Running MySQL 5

I installed MySQL 5 with

sudo port install mysql5 +server

Trying to start it with mysql5 gave the error

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

There were a lot of mentions of this on Google, but solutions were hard to find.

What worked for me was to run

sudo mysql_install_db5 --user=mysql

which I believe creates the required default databases, then start MySQL with

sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper start

Staging ncurses

I tried to install some ports (git-core, readline) that have ncurses as a dependency.

Installation seemed to get stuck at

--->  Staging ncurses into destroot

The issue was as described here.

Fixed by running

sudo port clean --all ncurses ncursesw
sudo port upgrade ncursesw
sudo port install ncurses

After that, the ports that had previously stuck now completed fine.