MySQL Forums
Forum List  »  MySQL Workbench

"Unable to connect to localhost" misleading error
Posted by: Aaron Seet
Date: December 12, 2023 03:35AM

We recently implemented VPN to let developers connect to our internal network and access database servers in certain subnets. (Previously was SSH tunnel via bastion hosts.)

With the switch, a few users could not connect with the error "Unable to connect to localhost" which is perplexing since they are not connecting to their own computers but remote servers.

After much confusion and investigation, it turned out to be two scenarios.

1. DNS resolution failure. Some users with their home wifi routers acting as its own DNS server were somehow not able to resolve our internal database host names (in public domain). Resolution (and database connection) worked after configuring for a more reliable DNS service (like Google DNS servers).

2. Unreachable network route. Users are only allowed certain subnet routes based on their group membership. Packets never reach the destination subnets if they don't belong to the correct group.

Workbench ought to be more specific about the actual networking failures with "host name not found" and "Network destination unreachable/server unresponsive" respectively instead of a totally inaccurate complaint about "localhost".

Options: ReplyQuote


Subject
Views
Written By
Posted
"Unable to connect to localhost" misleading error
1422
December 12, 2023 03:35AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.