一、修改data目录下的 pg_hba.conf 文件
将以下这行
host all all 127.0.0.1/32 md5
改为如下:
host all all 127.0.0.1/32 trust
二、运行cmd,进入postgres安装路径的bin目录,运行如下命令:
psql -U postgres
postgres=# alter user postgres with password '你要设置的密码';
postgres=# \q
三、修改data目录下的 pg_hba.conf 文件
将以下这行
host all all 127.0.0.1/32 trust
改为如下:
host all all 127.0.0.1/32 md5
重新启动postgres
我的这篇文章是修改服务器的密码,如果还需要在此输入密码,就是你的数据库密码和服务器的密码不一样
https://blog.csdn.net/qq_28289405/article/details/80263929
转自:https://blog.csdn.net/rick_123/article/details/7000622