How to Create MySQL Database in AWS RDS [7 Steps]

In this article we are going to cover How to Create MySQL Database in AWS RDS and How to Connect MYSQL RDS from EC2 Instance

How to Create MySQL Database in AWS RDS

Step #1:  In the top right corner of the Amazon RDS console, select the Region in which you want to create the DB instance.

select the Region in which you want to create the DB instance 1 1

Step #2: In the navigation pane on the left, click Databases. Then click Create Database

click Databases. Then click Create Database 2 1

Step #3: Select MySQL icon and then click Select.

MySQL icon and then click Select 3 1

Step #4: Select MySQL Edition and Version

Select the mysql Edition 4 1

Step #5: Select DB Engine, DB engine version and DB instance class

Now configure your DB instance 5

Step #6: Input RDS name, Master UserName and master password

Now configure your DB instance 6

Step #7: Configure MySQL RDS Advanced Settings

VPC:  Select Default VPC.

Subnet Group: Choose the default subnet group

Publicly Accessible: Choose Yes.

Availability Zone: Choose No Preference. 

Configure Advanced Settings 7

VPC Security Group(s): Select Create New Security Group -àselect  Type as All Traffic and Source Anywhere .(Here we select existing one mydb0001)

Database Name: mydb0001

Port: 3306

DB Parameter Group: Leave the default value of default.mysql5.7.

Option Group: Select the default value of default: mysql5.7. 

Enable Encryption: No

Configure Advanced Settings 8

Auto Minor Version Upgrade: yes

Maintenance Window: Select No Preference.

Click on Create Database

create database 9

wait till to configure MySQL RDS once done click on View DB instance details.

view db instance details 10

How to Connect MYSQL RDS from EC2 Instance

Open MySQL RDS and copy the Endpoint and port number

Check whether a port is open 11

Open an EC2 instance, install mysql client

on Ubuntu and EC2 Linux

yum -y groupinstall "MYSQL Database Client"
sudo apt-get install mysql-client

To Login MySQL RDS, use below command

mysql –u [MasterUserName] –h [endpoint] –p [password]
input rds endpoing and port 12

Show Databases

show database in aws mysql rds 13

To Create database

create database database name
create database in aws rds 14

Then Use database Name

Create Table and Insert Data into table

db operations in aws rds 15

Select , Update and Delete data from Table

Update and Delete data from Table 16

Conclusion:

We have covered How to Create MySQL Database in AWS RDS and How to Connect MYSQL RDS from EC2 Instance

Related Articles:

How to Create IAM User in AWS Step by Step

How to Attach IAM Role to EC2 Instance using CLI

How to Create Ubuntu Instance in AWS [7 Steps]

How to Create Linux EC2 Instance in AWS

AWS Create EC2 Instance from Snapshot

How to connect to AWS EC2 Instance using MobaXTerm

How to Enable Password Authentication for AWS EC2

How to Connect EC2 Instance using Putty

How to Transfer files to AWS Instance using WinSCP [2 Steps]

How to Install AWS CLI on Amazon Linux

How to Mount EFS on EC2

Lambda Function to Start and Stop RDS Instance

Start and Stop EC2 Instance using Python Boto 3

How to Create AWS DocumentDB and Connect [3 steps]

How to Install MySQL 5.7 on Amazon Linux 2

How to Create Postgres Database in AWS and connect

Monitoring EC2 Instances using CloudWatch

How to Create CloudFront Distribution in AWS

How to Migrate EC2 Instance to another Region

How to Increase EBS Volume size in AWS [4 Steps]

Reference:

AWS MySQL RDS official page

About DevOps Hint

DevOps Hint Founded in 2020 Community Site where you can find about How to Guides, Articles and Troubleshooting Tips for DevOps, SRE, Sysadmins and Developers.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link