top of page

Establish Connection between Amazon RDS and MySQL Workbench

Configure Amazon RDS with MySQL engine and establish connection from MySQL Workbench.


Objectives:

1. Learn RDS and deploy MySQL database engine using RDS service.

2. Test RDS/MySQL database connection from MySQL Workbench.


Step 1: In EC2 service console, go to Security groups in side panel. Click on Create security groups.


Create a Security Group for Linux Server with following configuration:

Security group name: LinuxSG

Description: Security Group for Linux Server

Type: SSH

Source: 0.0.0.0/0

Click on Create security group button in bottom right corner. Confirm that it is created.


Go back to EC2 service console, go to Security groups in side panel. Click on Create security groups.

Provide Security group name as RDS-SG.

Provide Description as Security Group for Database.

Provide following Inbound rules:

1. Type: SSH

Source:0.0.0.0/0

2. Type: MySQL/Aurora

Source:0.0.0.0/0

3. Type: MySQL/Aurora

Source: LinuxSG (security group that would be used to create the EC2 instance


Click on Create security group button in bottom right corner. Confirm that it is created.


Step 2: Go to RDS service console. Click on Create database.

Choose a Standard create database creation method.

Select the MySQLradio button in Engine options. Confirm your MySQL 8.0.20


Select the Dev/Test in Templates.

Under Settings:

Give DB instance identifier as mydatabase1.

Provide Credentials Settings as per your choice and store it in a secure place. We refer to following values for this document:

  • Master Username: rdsuser123

  • Master password: rdspass123


Let the DB instance class be Standard Classes and size be db.m5.xlarge.

Confirm the default Storage settings as Storage type: General type- General Purpose (SSD) and Allocated storage 20 GiB.

Uncheck the Enable storage autoscaling.

Under Availability & durability select Do not create a standby instance radio button.

Connectivity section will have Default VPC selected.

Click on Additional connectivity configuration for dropdown.

  • Select default-vpc Subnet group.

  • Select Yes radio button under Public access.

  • Select Choose Existing radio button in the VPC security group.

  • In the Existing VPC security groups default will be selected. Remove this security group by clicking on the cross sign. Select the RDS-SG created in the previous step.

  • In Availability Zone select 1a which should be the same as the AZ of Linux Instance.

  • The Database port will be default 3306.


Database authentication is set to Password authentication.

Click on Additional configuration dropdown.

Provide Initial database name as cloudPlusPlusLab.

DB parameter group and Option group will be default mysql8.0.


In Backup the Enable automatic backups will be checked.

Backup retention period will be 0 days.

Backup window will have No preference selected.

Uncheck Copy tags to snapshots.

Uncheck Enable Encryption.

Uncheck Enable Performance Insights.

Uncheck Enable Enhanced monitoring.

Uncheck all options under Log Exports.

Uncheck Enable auto minor version upgrade.

Select No preference for Maintenance window.

Uncheck Enable deletion protection.

Ensure no additional cost is being incurred in the Estimated monthly cost section.

Click on Create database button in bottom right corner.

Confirm that the database is created and Available.


Step 3: Open the MySQL Workbench application on your device.


Click on the plus icon to connect a new Database.


Enter the following configurations to connect to your AWS RDS.

Connection Name: My-Connection

Username: rdsuser123



To enter the password, click on store in vault and enter your password

Password: rdspass123


To get the hostname, go back to your AWS console, Click, on your RDS Instance and copy then endpoint.

Paste the endpoint in the hostname filed and Click, on ‘OK’.



Thus we have successfully established connection with RDS using MySQL Workbench.

Note: Delete RDS instance and Security groups if you no longer need them.

Was this document helpful? How can we make this document better. Please provide your insights. You can download PDF version for reference.


AmazonRDS_Connection_MySQLWorkbench_1-Sep-2021
.pdf
Download PDF • 768KB

We provide best AWS trainings from Pune, India.


For aws certification contact us now.



1,312 views35 comments

Recent Posts

See All
bottom of page