skip to Main Content

I’ve created an RDS instance on AWS and am trying to connect to it using MySQL Workbench from my local machine. I’ve configured the RDS instance to be publicly accessible, it sits in a public subnet with access to an internet gateway, and its VPC security group accepts traffic from my IP address on port 3306. However, I cannot connect to the database (MySQL Workbench times out).

My RDS configuration:

enter image description here

My security group configuration:

enter image description here

The only way I can connect to it without issues is by configuring the security group to accept all traffic using IP 0.0.0.0/0 on port 3306, which has some obvious security concerns. I believe the fact that I can connect when the security group accepts all traffic proves that the problem is not with my ISP or any firewalls on my local network.

I feel like I’ve tried everything. Is there anything I’m missing?

2

Answers


  1. Chosen as BEST ANSWER

    Solution

    For anyone using AWS RDS on a Mac, the solution to this problem is very straightforward. Just turn off Apple's Private Relay by going to System Settings > 'Your Name' > iCloud > Private Relay. This service routes your requests through multiple relays that encrypt your data and generate temporary IP addresses. The temporary IP addresses are what messes things up in this case.

    I can't believe this took me a week to figure out. I hope I can save someone else some time :)


  2. The rule that you have allows traffic from 172.x.x.x, which is actually your subnet’s IP range.
    If you’re trying to access from your local machine, you have to add your own IP address to the security group allow rules. You can do that in 2 ways:

    1. go to some online service, like WhatIsMyIPAddress, and add the address that you get
    2. Go to security group -> Edit Inbound rules -> Add rule -> Traffic type MySQL/Aurora -> For Source, choose "My IP". That will populate your IP address and you should be able to connect to the DB from your local machine.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search