yaodong
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.

http://serverfault.com/questions/110154/whats-the-default-superuser-username-password-for-postgres-after-a-new-install

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: