How to connect with a SQL client to a private RDS database instance using SSH over EC2

If you have a private RDS database which accepts connections only from within your VPC you cannot directly connect to it with a SQL client like MySQL Workbench. However using an EC2 instance in a public subnet as a relay, you can use SSH over TCP/IP or SSH tunneling to connect to this RDS instance even from outside your VPC.

This video shows you how to do this with two SQL clients: MySQL Workbench and HeidiSQL.

IMPORTANT: you need to whitelist your EC2 instance in the DB security group in order to be allowed access from the EC2 instance.

Recent Articles

Related Stories

1 Comment

  1. this works perfectly!
    i was beating my head on the floor trying to figure this out before i found this.
    thank you!

Leave A Reply

Please enter your comment!
Please enter your name here