我刚安装了PostgreSQL 9.2从EnterpriseDB的到Mac OS X 10.8.2.我输错了postgres用户密码,所以无法连接.如何重置密码?
Hea*_*ers 72
找到方向:
sudo su postgres
Run Code Online (Sandbox Code Playgroud)
修改/Library/PostgreSQL/9.2/data/pg_hba.conf
-local all all md5
+local all all trust
Run Code Online (Sandbox Code Playgroud)
重启postgres
/Library/PostgreSQL/9.2/bin/pg_ctl restart -D /Library/PostgreSQL/9.2/data/
Run Code Online (Sandbox Code Playgroud)
连接到postgres:
psql
Run Code Online (Sandbox Code Playgroud)
在psql里面(\q要退出):
ALTER USER postgres WITH ENCRYPTED PASSWORD 'password';
Run Code Online (Sandbox Code Playgroud)
修改pg_hba.conf
+local all all md5
-local all all trust
Run Code Online (Sandbox Code Playgroud)
重启postgres
/Library/PostgreSQL/9.2/bin/pg_ctl restart -D /Library/PostgreSQL/9.2/data/
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
44135 次 |
| 最近记录: |