忘了PostgreSQL数据库的密码的解决方案

问题:忘了PostgreSQL数据库的密码应该如何解决?

 解决方法: 首先打开data目录下的pg_hba.conf配置文件,

找到:

 # IPv4 local connections: host all all 127.0.0.1/32 ident

然后把ident(或md5)改成trust,

重新启动。

psql -d template1 -U postgres -c "alter role postgres password ‘123456’;"

posted @ 2010-06-02 12:41  百年俊少  阅读(714)  评论(0编辑  收藏  举报