trilogy-libraries / trilogy

Trilogy is a client library for MySQL-compatible database servers, designed for performance, flexibility, and ease of embedding.
MIT License
697 stars 68 forks source link

How did you solve the connection "feature" that translates `localhost` to a local UNIX socket? #156

Closed ruyrocha closed 7 months ago

ruyrocha commented 7 months ago

Hey trilogy team,

It seems that MySQL client library translates connections to localhost to a local UNIX socket, instead of making a TCP connection to localhost address - which is 127.0.0.1.

Such behavior was initially reported to MySQL team on 2007, and it seems that they claim it's not a bug, regardless if I use the mysql CLI tool, mysql2 gem, but trilogy is handling that case in the correct way.

I need to borrow your wisdom on this topic:

  1. how did you solve this issue?
  2. is it possible to point me in the code where did you solve it?
jhawthorn commented 7 months ago

Trilogy is its own client library and we simply didn't implement that. You either specify a host: and we will use TCP or you can specify a socket:.

Hope this helps!