Creation of RDS and restoring SQL file to RDS

From PheonixSolutions
Jump to navigation Jump to search

Creation of RDS and restoring SQL file to RDS

[edit]

Step 1

Log in to the AWS console and navigate to the RDS service.

Step 2

Click on “Create database”

Step 3

1. Choose a database creation method

Standard create (or) if new go with “Easy create”

2. Engine options:

Choose the required database

3. Templates:

production (or) dev/test (or) free tier

4. Settings

DB cluster identifier: Database name Master username: postgres
Password: **********

5. Instance configuration

DB instance class: choose an instance type

6. Storage

Storage type: Allocated storage:

7. Connectivity

Choose VPC and Security group

8. Database authentication

Choose “password authentication”

Click on “Create database”

Step:4

Login to Instance and try to connect RDS with the below command.

  psql -h <end point> -p portnumber -U username

psql -h leapfinanace-prod-vpc.cgveth26qa0v.ap-south-1.rds.amazonaws.com -p 5432 -U postgres

\l --- to list the databases.
\c -- to connect database
\dt ---- to list the tables

To restore the table

Create a user and grant all privileges and restore the tables

  psql -h <end point> -U postgres -p 5432 -d databasename -f filename.sql
  psql -h database-1.cgveth26qa0v.ap-south-1.rds.amazonaws.com -U postgres -p 5432 -d leapcommunication -f whatsapp_outbox_old_2.sql