Wednesday, March 20, 2024

Install and configure PostgreSQL in AWS EC2 Instance running Ubuntu and Register Server to the Local PgAdmin

 
Install and configure PostgreSQL in AWS EC2 Instance running Ubuntu and Register Server to the Local PgAdmin


Ensure the following steps:

  • AWS-EC2 instance machine running.
  • PgAdmin(PostgreSQL) has been installed in your system. 

Step 1: Update the VM(Ubuntu).

  • sudo apt update  - this command will update your Ubuntu machine. 

Step 2: Install PostgreSQL

  • sudo apt update  - this command will install the PostgreSQL package manager. 
  • sudo service postgresql status -  verify that PostgreSQL is running by checking its status.

Step 3: Access PostgreSQL

  • sudo -i -u postgres  - this command will enter into the PostgreSQL. 
  • psql-  it will allow you to create a Database, user, and privileges.

Step 4: Create a User and Database.

  • Create User Name & Password : 
    • CREATE USER firstuser01 WITH password 'First04@';
  • Create a Database Name: 
    • CREATE DATABASE devapdb; 
  • Grand permissions:
    • GRANT ALL PRIVILEGES ON DATABASE devapdb TO firstuser01;
          







No comments:

Post a Comment