DEV Community

Cover image for How to connect AWS RDS with MySQL Workbench application.
Surya Shankar
Surya Shankar

Posted on

How to connect AWS RDS with MySQL Workbench application.

What is AWS RDS?

Amazon RDS is a Relational Database Cloud Service.
Amazon RDS creates multiple instances for high availability and failovers.
Amazon RDS supports PostgreSQL, MySQL, Maria DB, Oracle, SQL Server, and Amazon Aurora.

Note

  • RDS should always be configure inside a private subnet as because its a Database.
  • Backup retention is very easy in case of RDS.
  • RDS has an endpoint through which we can able to connect it with mysql workbench.

QS)-Now the question is how to connect AWS RDS which is present inside a private subnet of VPC from our local computer application [ MYSQL Workbench ]?

  • Ans:- One of the way is through OpenVpn setup. Once we able to setup an OpenVpn network , We can associate Host name ,port,Username,Password of RDS to our MYSQL workbench and able to connect.

Image description

LAB WORK

RDS setup

  1. Create a VPC. [CIDR range :- 10.0.0.0/16]

Image description

  1. Create two Private subnet with subnet association inside that VPC [ Atleast 2AZ] .Ipv4 CIDR:- 10.0.2.0/24 and 10.0.4.0/24

Image description

Image description

  1. Create subnet groups and attach all subnet present inside that VPC.

Image description

Image description

  1. Launch a RDS inside those private subnet.

Image description

Image description

-Create username and password.
Image description

Image description

Image description

Image description

Image description

Image description
-Copy the endpoints and attach it in Mysql workbench host name.

Image description

OpenVpn Setup

  1. Create an Internet Gateway attach it with that VPC.

Image description

  1. Create One public subnet with subnet association and routes table associated with internet gateway.

Image description

Image description

  1. Deploy an OpenVpn in the Public subnet and connect it through xshell. -launch configuration.
  2. Search for Openvpn.
  3. Select OpenVpn Access server and launch it.

Image description

Image description

Image description

  1. Install OpenVpn ,set the username and password and get the admin and client url for further use.

Image description

-Change the password.

Image description

  • Copy and paste the admin and client url for further use.

Image description

-Go to openvpn application and paste client url.

Image description

-Enter your username and password and connect.

Image description
-Now turn on VPN.
Image description

  • Download and install MySQL Workbench.
  • Open MySQL Workbench, and choose the βŠ• sign beside MySQL Connections to set up a new connection.
  • In the Setup New Connection dialog box, enter a suitable name for your connection.
  • In the Parameters section, enter the following details:
  • Host name: Enter the RDS endpoint
  • Port: Enter Port the number
  • Username: Enter the master user

Image description

Image description

  • Choose Test Connection.
  • In the popup that appears, enter the password that you configured when you created the DB instance, and then choose OK.
  • After testing your connection, from the Setup new connection dialog box, choose OK to save the connection. -Now You have successfully connected to Aws rds.

Image description

Image description

Top comments (0)