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

原文地址:https://www.cnblogs.com/zhouxiuquan/p/1912362.html