[patch] Using alternate MySQL unix socket
|Reported by:||Geert Vanderkelen <geert@…>||Owned by:||adrian|
|Component:||Database layer (models, ORM)||Version:||magic-removal|
|Severity:||normal||Keywords:||mysql socket unix_socket|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Attached a patch which allows an alternate UNIX socket to be used for MySQL. The default is /tmp/mysql.sock, but this is mostly changed to a path like /var/run/mysql or /var/lib/mysql in production.
I have made it so that when DATABASE_HOST starts with a '/' it is a socket, otherwise it's a HOST. This might not work on Windows, but heck, who's using namedpipes anyway :)