If you need to specify a MySQL server via it’s socket, and it’s not on the default socket, here’s how you do it when installing MODx, or editing your manager/includes/config.inc.php file. The "host" variable ($database_server in the config file), which is typically set to "localhost" or even "localhost:port" can also take the path to your socket file:
:/path/to/nonstandard/mysql.sock
It is mandatory to specify the full colon at the beginning of the path. This is what tripped me up in the past and I only realized this when tracing through the DBAPI code and reading the PHP manual today.
Hope this helps someone.
p.s. Unless I’m crazy, connecting via an explicit socket feels like it gives a site a performance boost too - the incremental performance improvement of socket connections must multiply themselves over the course of all the database activity that MODx incurs on a single page request.