Connecting to RDS Database from EC2 instance and creating tables | Scribe

    Connecting to RDS Database from EC2 instance and creating tables

    • Hafeez Baig |
    • 31 steps |
    • 2 minutes
    information ordinal icon

    Refer to the following guide to learn how to use IAM in the cloud\ <https://scribehow.com/shared/Creating_an_IAM_User_and_User_Group_in_AWS_Management_Console__hWNiiXlcRJKFqYZZEJD-cg>

    1

    Sign in to **AWS Management Console** as an **IAM User** **Pre-requisite** - Ensure you have selected the AWS region closest to your location\ For this guide, we will be using us-east-2 (Ohio) as a preferred choice

    2

    Type **RDS** in the search bar and click on **RDS** to view the RDS Dashboard

    information ordinal icon

    **What is Amazon RDS?** Amazon RDS (Relational Database Service) is a cloud-based service offered by Amazon Web Services (AWS) that simplifies the setup, operation, and scaling of relational databases. It provides managed database solutions for popular database engines like MySQL, PostgreSQL, Oracle, SQL Server, and MariaDB, handling tasks such as provisioning, patching, backup, recovery, and scaling, allowing users to focus on their applications rather than database management.

    3

    On the **Amazon RDS** dashboard, click on the **Databases** from the left bar

    4

    **Databases** wizard will open, click on the DB identifier **mysqldatabase**

    information ordinal icon

    Refer to this guide to learn how to create an Amazon RDS Database\ <https://scribehow.com/shared/Creating_Your_First_RDS_Database_in_AWS__npccXKYTRse0Ba8bG3fncg>

    5

    **mysqldatabase** wizard will open, scroll the page and click on the **Connectivity & security** tab to view the Endpoint of the Database

    6

    Open the text editor and copy Endpoint, user, password and databasename from the **Connectivity & security** section

    7

    Type **EC2** in the search bar and click on **EC2** to view the EC2 Dashboard

    information ordinal icon

    **What is EC2 in AWS?** Amazon EC2 (Elastic Compute Cloud) is a web service provided by Amazon Web Services (AWS) that offers resizable compute capacity in the cloud. It allows users to rent virtual servers, known as instances, and run their applications on them. EC2 instances can be easily scaled up or down to accommodate changing workload demands, and users only pay for the compute capacity they consume.

    8

    On the EC2 dashboard click on **Instances** from the left bar to view the EC2 instances

    9

    **Instances** wizard will open, select the **RDS Instance** instance

    information ordinal icon

    Refer to this guide to learn how to create an EC2 instance for RDS Database\ <https://scribehow.com/shared/Creating_an_EC2_instance_to_connect_to_RDS_Database__eVVBl7QmRFiYSohIAJ9KTw>

    10

    On the top right corner click on the **Connect** button

    11

    **Connect to instance** wizard will open, click on the **Connect** button

    12

    On the EC2 Instance Connect page type the command [[sudo yum update]]

    information ordinal icon

    **What is the sudo yum update command?** "**Sudo yum update**" updates software packages on Linux systems using RPM Package Manager, granting administrative privileges with "sudo."

    13

    Type the command [[sudo su ]]to get the root user access

    14

    Type the command [[dnf -y install mysql mysql-community-client ]]to install mysql client