Ubuntu 9.10下PostgreSQL 8.4忘記密碼的解決方法:
1.
編輯pg_hba.conf中的
83 # IPv4 local connections:
84 host all all 127.0.0.1/32 trust
-
mickey@pentest:/etc/postgresql/8.4/main$ sudo vim pg_hba.conf
mickey@pentest:/etc/postgresql/8.4/main$ sudo /etc/init.d/postgresql-8.4 restart
* Restarting PostgreSQL 8.4 database server [ OK ]
2.
mickey@pentest:~$ psql -h 127.0.0.1 -U postgres
psql (8.4.2)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type “help” for help.
postgres=# ALTER USER postgres WITH PASSWORD ‘mickey’;
ALTER ROLE
postgres=# \q
3.
將pg_hba.conf中的該回
83 # IPv4 local connections:
84 host all all 127.0.0.1/32 md5
mickey@pentest:/etc/postgresql/8.4/main$ sudo vim pg_hba.conf
mickey@pentest:/etc/postgresql/8.4/main$ sudo /etc/init.d/postgresql-8.4 restart
* Restarting PostgreSQL 8.4 database server [ OK ] 本文出自:億恩科技【1tcdy.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|