Pages

Install postgreSQL on ubuntu

Tuesday, October 29, 2013

Summary:
--------
Install postgreSQL database on ubuntu system

Step 1:
-------
Update your system.

$ sudo apt-get update

Step 2:
-------
Install postgresql and associated packages

$ sudo apt-get install postgresql postgresql-contrib


Step 3:
-------
We need to stop Postgres server.

$ sudo service postgresql stop

Step 4:
-------
Navigate postgres user. Change PostgreSQL root user password.

$ sudo su postgres
$ psql


postgres=#  ALTER USER postgres WITH PASSWORD 'Passw0rd';
postgres=# \q


Step 5:
-------
We need to set the access permission  as trust to root user. The default access is md5. Open pg_hba.conf file

$ sudo subl /etc/postgresql/9.1/main/pg_hba.conf

Make sure the following commands

# Database administrative login by Unix domain socket
local   all             postgres                                trust

Step 6:
------
We must restart the postgresql

$ sudo service postgresql restart

No comments:

Post a Comment