Reset Password Root di Postgresql

Berikut cara melakukan reset password root pada postgresql di linux.

1. Edit file config PostgreSQL menjadi trust untuk dapat login tanpa password :

# vi /var/lib/pgsql/data/pg_hba.conf
cari baris :
local all postgres password
Ganti menjadi :
local all postgres trust

2. Restart PostgreSQL Server:
# service postgresql restart

3. Ganti password:
# psql -U postgres template1 -c alter user postgres with password ‘newpassword’;

4. Password has been updated. Revert back the original settings of config file:

# vi /var/lib/pgsql/data/pg_hba.conf

Baris yg tadi diganti :
local all postgres trust

Kembali menjadi :
local all postgres password

5. Restart kembali, dan user password pun siap digunakan.

# service postgresql restart





Calendar

May 2012
M T W T F S S
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 1 2 3

Category Key

  • General

© alfach.com 2012 - Feel free to leave your comment