Add mysqlnd.localhost_override option. #275

wants to merge 1 commit into


None yet
3 participants

asannes commented Feb 10, 2013

When localhost is encoundtered in mysqlnd, it is overriden by /tmp/mysql.sock or socket_option.

Many distributions have their own custom patches to have a correct default for their distribution. This pull request adds mysqlnd.localhost_override ini option to configure it from their configuration options.

The implementation is straightforward and it is backward compatible, if you do not set it the behaviour is as it used to be.

A side effect is that you can use remote hosts as the override (tcp://ip:port). Many applications use localhost as the default host, and it would be nice if it was easier to configure it to use alternative hosts.

Another case that would also benefit is where a host goes from having mysql on the localhost to a seperate host.


smalyshev commented Aug 25, 2013

Not sure why it is necessary - if you want different socket path, there are socket configurations, why congifure it via "localhost override"? Even more strange would be to override localhost with remote connection having nothing to do with localhost.

Comment on behalf of krakjoe at

The default socket location is configurable by normal means.

This is not necessary.

php-pulls closed this Jan 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment