You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked into this a little and it seems that this is actually a MySQL quirk. A couple lines from the docs:
If host is NULL or the string "localhost", a connection to the local host is assumed:
On Unix, the client connects using a Unix socket file. The unix_socket parameter or the MYSQL_UNIX_PORT environment variable may be used to specify the socket name.
So it doesn't seem to be the fault of mysql-simple.
However, I was confused that even when I pass connectOptions = [Protocol TCP] in the ConnectInfo, it still tries to use the socket. I would have thought that this option would be the same as --protocol=tcp when using the MySQL CLI client. Indeed, the docs also say
You can also influence the type of connection to use with the MYSQL_OPT_PROTOCOL or MYSQL_OPT_NAMED_PIPE options to mysql_options().
I see that mysql_options is theoretically getting called as part of the connect process in the wrapper library below this one:
It's annoying to have to use "0.0.0.0" because using "localhost" forces it to try to use a socket, even if it doesn't exist.
If you're going to try to use the socket and be helpful, don't fail if we provide a port.
The text was updated successfully, but these errors were encountered: