Setting up a PostgreSQL Database on Ubuntu

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install postgresql
# TYPE  DATABASE        USER            ADDRESS                 METHOD # "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# TYPE  DATABASE        USER            ADDRESS                 METHOD # "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
#listen_addresses = 'localhost'
listen_addresses = '*'
sudo /etc/init.d/postgresql restart
sudo - su postgres
psql
CREATE USER ubuntu_user SUPERUSER;
ALTER USER power_user WITH PASSWORD 'password';
CREATE DATABASE mydatabase WITH OWNER power_user;

Related Blog Posts

Related Market Product

Related Documentation

Related Products

Reference

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store