Troubleshooting Connection Issues Between MySQL Workbench and AWS RDS

0

Hello!

I'm experiencing a persistent issue when trying to connect MySQL Workbench to my AWS RDS instance and I am hoping for some guidance to resolve this problem.

I am unable to connect to my MySQL database hosted on AWS RDS from MySQL Workbench. Despite entering the correct username, password, and endpoint details, I receive an error message stating, "Failed to Connect to MySQL at [RDS endpoint]:3306 with user [username] - Unable to connect to localhost".

Troubleshooting Steps Taken:

  • Confirmed that the RDS instance is in an "available" state via the AWS Management Console.
  • Verified that the security groups associated with the RDS instance allow inbound traffic on port 3306 from my IP address.
  • Checked the MySQL Workbench connection settings to ensure the RDS endpoint is correctly entered, not 'localhost' or '127.0.0.1'.
  • Ensured the username and password are correct and there are no typos.
  • Verified that my MacBook Pro's firewall allows outbound connections on MySQL's default port.
  • Attempted to connect to the RDS instance without using SSH (since the RDS instance is not set up for SSH connections).
  1. Are there additional settings or configurations within MySQL Workbench that I should verify or adjust?
  2. Should I be looking at any specific logs on my MacBook or within AWS to gain more insights into the connection failure?
  3. Is there a recommended method for testing the connectivity to the RDS endpoint outside of MySQL Workbench to rule out issues with the Workbench itself?
  4. Any insights on why the error message indicates "Unable to connect to localhost" despite providing the AWS RDS endpoint?

**Environment Details: **

  • MySQL Workbench Version: MySQL Workbench 8.0 (64 bits)
  • AWS RDS Engine: MySQL 8.0.35
  • RDS Instance Class: MySQL Community
  • Operating System: macOS Sonoma 14.4.1

I would greatly appreciate any advice or suggestions, as I am stuck. Thank you in advance for your time and help!

George

1 Answer
0

Take a look at the subnet group into which the RDS instance has been provisioned. All of the subnets that comprise the subnet group must be public subnets - that is to say each of them needs to have an entry in its route table which whose destination is an Intenet Gateway.

If the subnet group has a mix of pubilc and non-public subnets then this could be where your problem is. Amazon Reachability Analyser may be able to help you here https://aws.amazon.com/blogs/database/troubleshoot-network-connectivity-to-amazon-rds-databases-using-vpc-reachability-analyzer/

if you're still having trouble after all this, further things to try are listed in these docs https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Troubleshooting.html https://repost.aws/knowledge-center/rds-cannot-connect

profile picture
EXPERT
Steve_M
answered 14 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions