changing passwd

June 4, 2007 at 8:33 am 1 comment

Make sure the password is in /var/lib/pgsql/.pgpass

The format is as follows…

*:*:*:postgres:PASSWORD

Modify /var/lib/pgsql/data/pg_hba.conf

It should contain the following…

local all all md5
host all all 127.0.0.1 255.255.255.255 md5

Change ‘md5’ to ‘trust’ to disable authentication then restart postgres.

`/etc/init.d/postgresql restart`

Now you should be able to connect to postgresql as user ‘postgres’ without a password to modify the password.

`psql -u template1`

Run the following sql command.

“alter user postgres with password ‘NEW PASSWORD HERE’;”

Finally change /var/lib/pgsql/data/pg_hba.conf back to its original format and restart postgresql one more time. Now you should be able to authenticate using user postgres and the password you specified.

Advertisements

Entry filed under: PostgreSQL.

for vim user

1 Comment Add your own

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


June 2007
M T W T F S S
« May    
 123
45678910
11121314151617
18192021222324
252627282930  

%d bloggers like this: