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.

Leave a Reply

Your email address will not be published.