The socket option of mysql only works when the hostname is set to localhost. As the mysql adapter doesn't set a hostname at all when a socket is given, this breaks when the default hostname has been set to something else than localhost, e.g. in a user's .my.cnf file. As one can't give both a hostname and a socket path at the same time, we can to simply force the hostname to localhost when a socket path is used to make things work again.
The socket option of mysql only works when the hostname is set to localhost. As the mysql adapter doesn't set a hostname at all when a socket is given, this breaks when the default hostname has been set to something else than localhost, e.g. in a user's .my.cnf file. As one can't give both a hostname and a socket path at the same time, we can to simply force the hostname to localhost when a socket path is used to make things work again.