我试图从窗口命令提示符登录到psql,但在下面收到了错误
C:Usersjjjjj>psql -U postgres
Password for user postgres:
psql: error: fe_sendauth: no password supplied
请帮忙!
我在Windows上的C:\Program Files\PostgreSQL\12\data下找到了文件pg_hba.conf,然后我将md5方法更改为trust,并从cmd重新启动psql。它对我有用。查看更多信息https://www.postgresqltutorial.com/postgresql-reset-password/
启用"无密码";通过编辑pg_hba.conf进行身份验证在ipv4&v6区段
# TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
#host all all 127.0.0.1/32 md5
host all all 127.0.0.1/32 trust
# IPv6 local connections:
#host all all ::1/128 md5
host all all ::1/128 trust