When connecting to localhostMySQL tries to connect over a unix socket on Unix, or shared memory on Windows. This will work in most situations - but will not work if the MySQL server is running in a VM/container.
This PR adds retry logic such that, if the connection fails and the host is not set or equal to localhost, we retry with 127.0.0.1.
Fixes #44
When connecting to
localhost
MySQL tries to connect over a unix socket on Unix, or shared memory on Windows. This will work in most situations - but will not work if the MySQL server is running in a VM/container.This PR adds retry logic such that, if the connection fails and the host is not set or equal to localhost, we retry with
127.0.0.1
.