8/22/2014 - 5:33 PM

Install PostgreSQL on Ubuntu 14.04

Install PostgreSQL on Ubuntu 14.04

update every time

sudo apt-get update
sudo apt-get dist-upgrade

install prefer apt-get

sudo apt-get install postgresql postgresql-contrib postgresql-clien

switch to psql console

sudo su - postgres
psql # under user posgres

user postgres is created by postgresql with no password, DO NOT change it by sudo passwd postgres.


change password for postgres

# sudo su - postgres psql
\password postgres

create a new user and db for your application

# sudo su - postgres psql
create user USER_NAME with password 'PASSWORD';
create database DB_NAME;
grant all privileges on database DB_NAME to USER_NAME;

you should read this: