sudo apt-get update && sudo apt-get upgrade

sudo apt-get install postgresql postgresql-contrib

Update password for default root postgres user

// This password uses for login the Linux System not for the Database Connection
sudo passwd postgres

Setup User and Password for Database connection

// switch to the postgres user that You just updated the password before
su - postgres

// change the password of the current default postgres user of database
psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'MY_PASSWORD';"

// Created Test DB
createdb mytestdb

// Connect to Test DB
psql mytestdb

// Database Connection
postgresql://postgres:[email protected]:5432/mytestdb?schema=public

Install PostgreSQL on Ubuntu

Category: Uncategorized
0
1042 views

Join the discussion

Your email address will not be published. Required fields are marked *