“psql: could not connect to server: Connection refused” Error when connecting to remote database
问题:
|
I am trying to connect to a postgres database installed in a remote server using the following command: psql -h This the error that occurs:
I already tried the following but the issue remains unresolved:
Am I missing something. Hope someone can help. |
|||||||||||||
|
----------------------------------------------------------------------------
cd /etc/postgresql/9.x/main/
open file named postgresql.conf
sudo vi postgresql.conf
add this line to that file
listen_addresses = '*'
then open file named pg_hba.conf
sudo vi pg_hba.conf
and add this line to that file
host all all 0.0.0.0/0 md5
It allows access to all databases for all users with an encrypted password
restart your server
sudo /etc/init.d/postgresql restart
“psql: could not connect to server: Connection refused” Error when connecting to remote database的更多相关文章
- could not connect to server: Connection refused (0x0000274D/10061)
Oracle Linux 6.8 PostgreSQL Server IP: 192.168.10.220 Windows 7 x64 pgAdmin Custom Port IP: 192.168. ...
- [nginx] connect() failed (111: Connection refused) while connecting to upstream, client: 101.18.123.107, server: localhost,
nginx一直报错, 2016/12/02 10:23:19 [error] 1472#0: *31 connect() failed (111: Connection refused)while c ...
- nginx访问502 gateway,*1 connect() failed (111: Connection refused) while connecting to upstream
安装好nginx,php环境后,配置虚拟主机,结果访问后就报502 gateway,查看日志文件后,显示错误如下: 2019/04/29 16:24:39 [error] 19433#19433: * ...
- nginx 报错 connect() failed (111: Connection refused) while connecting to upstream
公司网站搬迁到新服务器后,发现站点访问不了,network里面提示502,查看相关的server配置,感觉没有什么问题,经过测试发现txt.html.等非php文件能够直接访问,也就是php访问不了, ...
- docker 踩坑笔记之 psql: could not connect to server
最近在用docker跑rails,也遇到了一些坑,这里记录一下. 首先build项目: docker-compose build 然后就开始报错了: psql: could not connect t ...
- nginx 解决 connect() failed (111: Connection refused) while connecting to upstream,
嗯哼,刚装了个ubuntu的lnmp,我的天啊,踩的坑比我脂肪还多了 比如刚装完的时候访问显示502, 也不知道什么问题,就去看了一下nginx日志 /var/log/nginx/error.log ...
- 问题解决:psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
错误提示: psql: could not connect to server: No such file or directory Is the server running locally and ...
- 使用phpmailer插件发邮件失败提示:SMTP -> ERROR: Failed to connect to server: Connection timed out (110) smtp connect() failed;
一个邮件发送问题,整整弄了我一周时间,起因是这样的,之前弄的一个网站,需要在邮箱里面认证之后才可以注册成功.网站上线了差不多一年之后,客户突然跟我说,网站不能注册了,然后我就查看了一下代码. 发现报这 ...
- 解决connect() failed (111: Connection refused) while connecting to upstream
使用nginx时, 有可能遇到connect() failed (111: Connection refused) while connecting to upstream的问题. 如果upstrea ...
随机推荐
- 日期的本质是double
日期的本质是double,在多语种时用起来更方便.
- [Q]AdobePDF虚拟打印机自动保存PDF
使用打图精灵打印时,选择“Adobe PDF”虚拟打印机打印(注意不选择“打印到文件”),每张图纸都会弹出一个保存对话框,如何避免? 从 操作系统->控制面板->硬件和声音->设备和 ...
- Jquery中日期插件jquery.datepick的使用
jsp的代码: <%@ page language="java" contentType="text/html; charset=UTF-8" pageE ...
- C#操作xml文件进行增、删、改
进行操作的xml文件: products.xml <?xml version="1.0" encoding="utf-8"?><product ...
- apache 修改连接数(转)
1.先要修改最大连接数,必须了解Apache的MPM(Multi -Processing Modules,多道处理模块)Apache2.0中MPM分为3种(perfork.worker.event). ...
- Django ORM操作
ORM 常用操作进阶操作 #!/usr/bin/env python #_*_ coding:utf8 _*_ from __future__ import unicode_literals from ...
- java 基础知识2
- android的签名
安装好了android studio,默认是使用期限为一年的签名,并且不可以发布到正式版的apk里. 在使用第三方模块或者服务的时候,经常要求提供签名及其sha1或者MD5信息. 事实上这个签名和及其 ...
- css的三大特性
1.继承性 作用:子元素可以继承父元素的样式text-,font-,line-这些元素开头的都可以继承,以及color属性特殊性: ①. a标签的颜色不能继承,必须对a标签本身进行设置 ②. h标签的 ...
- 表格单元格td设置宽度无效的解决办法 .
http://zzstudy.offcn.com/archives/11366 在做table页面时,有时对td设置的宽度是无效的,td的宽度始终有内部的内容撑开,可以设置padding,但直接设置w ...
