Pages

Friday, July 1, 2011

How to alter password of Postgres user in BOSS Linux ?

To alter password of Postgres user in BOSS Linux,

1.Install Postgres

apt-get install postgresql-8.3


2.Edit pg_hba.conf


nano /etc/postgresql/8.3/main/pg_hba.conf

and add the following line

host    all        all    127.0.0.1/32    trust

3.Restart the Postgres server

/etc/init.d/postgres restart

4.Now open a terminal and login as posgres user

su postgres

and type

psql
This should redirect and you should get a similar prompt.


postgres@krishboss:/opt/test$ psql
Welcome to psql 8.3.6, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

postgres=#


Now execute the query to change the password for postgres user.

#alter user postgres with password 'postgres_password';
now the password for the postgres user has been modified.

Now you can connect postgres with pgadmi3 client .


Reference:


http://www.psoft.net/HSdocumentation/sysadmin/pgsql_passwd.html

No comments:

Post a Comment