Saturday, January 11, 2014

Installing PostgresSQL on Ubuntu



1.Verify that you do not already have installed PostgreSQL in your machine
Run the following command in your console

ps ax | grep postgres

2.If you get a response similar to the one below, then you have PostgreSQL installed

Ss 0:00 postgres: writer process
Ss 0:00 postgres: wal writer process
Ss 0:00 postgres: autovacuum launcher process
Ss 0:00 postgres: stats collector process

3.Install PostgreSQL on your system

sudo apt-get update
sudo apt-get install postgresql-9.1

4.Configure your PostgreSQL Password

sudo -u postgres psql template1
ALTER USER postgres with encrypted password 'your_password';
Press ctrl-d

5.Configure MD5 Autentication

sudo nano /etc/postgresql/9.1/main/pg_hba.conf

6.Update the

local all postgres

7.Entry to

local all postgres md5

8.Enable TCP/IP connections

sudo nano /etc/postgresql/9.1/main/postgresql.conf

Locate the line

#listen_addresses = 'localhost'

and change it to

listen_addresses = 'localhost'

9.Restart the postgresql

sudo service postgresql restart

10.Create the database

create database testdb;

11.List available databases

\list

12.List users

\du >>> List Users

No comments:

Post a Comment