Access AWS RDS DB in a Private Subnet From MySQL Workbench

April 19, 2019

You put your database in a private subnet. How do you still “Connect to Database” from MySQL Workbench?

Follow this procedure if you’ve already created an RDS instance in a private subnet and an EC2 instance in a public subnet:

  1. In MySQLWorkbench, click Connect to Database in the Database menu.
  2. As the Connection Method, select Standard TCP/IP over SSH.
  3. As the SSH Hostname, type the IPv4 Public IP of your EC2 instance.
  4. As the SSH Username, enter ec2-user.
  5. As the SSH Key File, type the path to your EC2’s private key file.
  6. The MySQL Hostname is the Endpoint of your database instance.
  7. The Server Port is typically 3306. It shows as Port in your DB instance.
  8. Enter your database’s Username.
  9. Click Store in Keychain… to enter your database’s password.
  10. OK.
Made-up database names.

That’s it! If your RDS database isn’t in a private subnet yet, it’s time to ask yourself, “Are You Well Architected?”

Serverless Handbook
Access free book

The dream team

At Serverless Guru, we're a collective of proactive solution finders. We prioritize genuineness, forward-thinking vision, and above all, we commit to diligently serving our members each and every day.

See open positions

Looking for skilled architects & developers?

Join businesses around the globe that trust our services. Let's start your serverless journey. Get in touch today!
Ryan Jones - Founder
Ryan Jones
Founder
Speak to a Guru
arrow
Edu Marcos - CTO
Edu Marcos
Chief Technology Officer
Speak to a Guru
arrow
Mason Toberny
Mason Toberny
Head of Enterprise Accounts
Speak to a Guru
arrow

Join the Community

Gather, share, and learn about AWS and serverless with enthusiasts worldwide in our open and free community.