公司断电,来电后服务器的postgre无法远程连接
首先登录服务器查看防火墙
https://www.php.cn/linux-443556.html
关闭防火墙后启动postgre
https://www.cnblogs.com/wang-yaz/p/10815251.html
发现还是启动失败
报错 pg启动报错: Job for postgresql-9.6.service failed because the control process exited with error code
解决:https://blog.csdn.net/weixin_42356358/article/details/88874068
https://cloud.tencent.com/developer/article/1391813
注意:
[root@VM_152_4_centos ~]# /usr/pgsql-11/bin/postgresql-11-setup initdb
Initializing database ... OK
这一命令会清空表,慎用!!!!!!!!
再次启动postgre,成功
https://www.jianshu.com/p/dac86752e488
但是远程连接仍然报错
could not connect to server:connection refused (0x0000274D/10061)is the server running on host ‘10.0.2.23’ and accepting TCP/IP connections on port 5432?
解决:
https://www.cnblogs.com/dagestar/articles/3557306.html
但是又报错
FATAL:no pg_hba.conf entry for host ‘10.0.32.180’,user’postgres’, database ‘postgres’, SSL off
解决:
https://cloud.tencent.com/developer/ask/38775