my.cnf order-of-precedence

I'm a MAMP guy -- it' just easy. Recently I went down a rabbit hole trying to install Apache/MySQL/PHP via MacPorts, broke everything, and tossed in the towel. However, when I tried to revert back to MAMP, I kept getting the following error:

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

A peek into /Applications/MAMP/Library/my.cnf showed socket = /Applications/MAMP/tmp/mysql/mysql.sock, so everything should have been working!

Well it turns out that there's an order-of-precedence in my.cnf files, and the one that was tripping me was a residual /etc/my.cnf (which I just had to rename to /etc/my.cnf.bk). You can see this order listed in the comment block of (some of) the my.cnf files:

# /etc/mysql/my.cnf: The global mysql configuration file.

# This file can be simultaneously placed in three places:
# 1. /etc/mysql/my.cnf to set global options.
# 2. /var/lib/mysql/my.cnf to set server-specific options.
# 3. ~/.my.cnf to set user-specific options.

And of course, /Applications/MAMP/Library/my.cnf.