pg_hba.conf,认证设置成md5认证连接出现:

postgresql FATAL: password authentication failed for user "postgres"

 

编辑pg_hba.conf,将md5认证修改成trust认证,编辑后退出保存

执行pg_ctl reload加载生效

psql连接,用alter role修改密码

执行以下命令

postgres=# alter role postgres with password 'yourpassword';

修改完数据库密码后可以查看当前postgresql 有多少用户,及对应的密码

postgres=# select rolname,rolpassword from pg_authid;

退出psql

编辑pg_hba.conf,将turst认证修改成md5认证,编辑后退出保存

执行pg_ctl reload加载生效

 

PostgreSQL:修改数据库用户的密码

相关文章:

  • 2021-04-25
  • 2022-12-23
  • 2021-12-04
  • 2022-02-19
  • 2022-12-23
  • 2021-12-19
  • 2021-12-17
猜你喜欢
  • 2021-09-04
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
  • 2021-12-29
  • 2021-08-21
  • 2022-02-11
相关资源
相似解决方案