Tunnel UNIX-socket with SSH or HAProxy

Forward PHP-application's MySQL-connections towards localhost to a remote server, edit ~/.ssh/config:

Host my-remote-database-server
    LocalForward /var/run/mysqld/mysqld.sock 127.0.0.1:3306

Do the same, with HAProxy:

global
    log /dev/log local0 notice
    user haproxy
    group haproxy
    stats socket /var/run/haproxy.stat level admin

defaults
    log …
more ...