Possible to use libmysqlclient-dev.lib functions (native c client) with mySQL Router?
The immediate answer, without more information, is that you are trying accessing MySQL (the protocol, not the server), using unix socket/named pipes, which is the only reason I can think from the top of my mind why a mysql connector may want to open a file. Check your connection options and make sure you are connecting using TCP, with a host, port combination.

It could be something else, but it is what I would try debugging first, for other issues we would need more context and code.