PostgreSQL连接失败怎么排查:Connection refused、no pg_hba.conf entry、密码认证失败逐一定位
连接PostgreSQL时报Connection refused、could not connect to server、no pg_hba.conf entry for host、password authentication failed或Peer authentication failed。本文按错误信息分类讲解原因:服务未运行、listen_addresses只监听本机、端口与防火墙、pg_hba.conf规则顺序与认证方式、peer与md5/scram的区别、密码加密方式不一致,以及修改后需要reload还是restart。
