李斯特 发表于 2016-11-21 05:35:38

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’;"

页: [1]
查看完整版本: PostgreSQL数据库忘记密码的解决方案