`
sunxboy
  • 浏览: 2827619 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

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

 
阅读更多

解决方法:

首先打开data目录下的pg_hba.conf配置文件,找到:

 

<ccid_nobr>
<ccid_code># IPv4 local connections:
host    all         all         127.0.0.1/32          md5

 

然后把md5改成trust,重新启动。

 


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

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics