Remotely connect to an AWS RDS instance using MySQL Workbench

publish on

How to connect and send SQL queries remotely to an Amazon Web Service RDS instance using MySQL Workbench

After having created a new Amazon Web Service RDS instance it's often useful to have access to it remotely to send SQL command.

By default a newly created RDS instance will deny any connection. So the first step is to create a new security rule (or edit an existing one) and add your IP address to gain access to the instance.

Navigate to the RDS console:


Then head to the security group screen, select or create a new security group:


And add your public IP address (don't forget to add the subnet mask for example /32 after the host).


Then we'll need to figure out what is the instance address, to do so go to the instance menu and write down the endpoint, port number and principal username:


Now launch MySQL Workbench (you can download it from the MySQL website):

On the top left, locate the '+' icon to add a new connection:


Then fill up the form as below:


Hostname: the endpoint of your RDS instance
Port: the port of your RDS instance
Username: your MySQL username

Click on Test connection, you should be prompted a dialog asking for your MySQL password:


Submit your password and you should finally have a notice, stating that the connection is working fine:


If it doesn't, be sure to double check your IP address in the security rule. It should be your public IP when you are accessing the Internet and not your local IP. You can retrieve your public IP with a site like http://www.whatismyip.com.

comments powered by Disqus