duckdb / duckdb_mysql

MIT License
45 stars 10 forks source link

Fix #44 - fallback to connecting over 127.0.0.1 if localhost connection fails #47

Closed Mytherin closed 5 months ago

Mytherin commented 5 months ago

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.