Saturday, August 09, 2014

How to install postgresql 9.3 in Ubuntu 14.04

Postgresql is very useful with ruby on rails to reduce complexity.

You can open terminal with "Ctrl + Alt + T" and run this command for install postgresql:

sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - 
sudo apt-get update
sudo apt-get install postgresql-common 
sudo apt-get install postgresql-9.3 libpq-dev

For login into postgresql
sudo -u postgres psql
If you want to create user named "sachin" then use this:
sudo -u postgres createuser sachin -s
For change password with user:
sudo -u postgres psql
postgres=# \password sachin
Reactions:

0 comments:

Post a Comment