Mysql Workbench Remote Connection Using Amazon RDS

Authors: Prachee Talreja & Pranita Prusty

Amazon Relational Database Service (Amazon RDS) is an open source cloud database that allows to set up, operate, and scale databases in the cloud. 

It is not a good practice to host databases and servers in the same local machine. A separate database server can improve security, hardware performance, and enable you to scale resources quickly. In such use cases, learning how to manage remote resources effectively is a priority.

In this blog we will learn how to make your local MySql database as a remote database by following some simple steps:

Prerequisites:

1. Download MySql Workbench –

https://dev.mysql.com/downloads/workbench/

2. Download visual c++ redistributable (x64) – 

https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

3. Create an AWS account on-  https://aws.amazon.com/getting-started/

STEP 1: Create a MySQL DB Instance

1. Go to Amazon RDS and click on create database

2. Select Engine option as “MySQL” . You can select a template as per your requirements. Here, we have selected “Free Tier”.

3. Provide database instance name and set credentials.

4. Provide DB details as per as requirement.

5. We can make changes in additional configuration as per our need.

6. Select on Create Database. It will take a few minutes and then Database Instance will be created. 

STEP 2: Creating a Connection with MySQL Workbench

1. Click on the add icon to create a new connection.

2. Provide the details required while setting up the new connection

Connection Name:  Provide a unique name according to your requirement

Host Name:  You will find under Connectivity and Security in the amazon account.

Port : By default, mysql uses 3306.

Username and Password: It will be the same you provided while creating db Instance.

NOTE: We can provide specific ip address of the machine under security group  and add inbound rule where we want to establish amazon rds connection.

3. After that, we can create a sample table in our database.

STEP 3: Connecting Database Instance with Anypoint Studio

1. Add Database config and provide required details as follows:

2. Here , we have created a demo application in anypoint studio where we are fetching data from the database.

3. Successfully data is fetched from the database.

We use cookies on this site to enhance your user experience. For a complete overview of how we use cookies, please see our privacy policy.