psql: could not connect to server: No such file or directory

SOLUTION 已验证 - 已更新 2015年三月27日19:52 -

English

环境

  • Red Hat Enterprise Linux 6 (RHEL)
  • PostgreSQL database

问题

  • We are unable to login the PostgreSQL database of Jon server application using the command psql. Tried to login as postgres and root user, but getting the same error. Please see the error details below and guide us fix this error ASAP.

Raw

bash-4.3$ psql
psql: could not connect to server: No such file or directoryIs the server running locally and acceptingconnections on Unix domain socket "/tmp/.s.PGSQL.5432"?

决议

  • The error message indicates that postgresql service is not running and listening to default tcp port 5432. Use the below command and confirm tcp port used by postgresql service. Then use correct command to connect it. For example :

Raw

# ps -ef | grep postgrespostgres  6043     1  0 16:20 ?        00:00:00 /usr/bin/postgres -D /var/lib/pgsql/data -p 5454
postgres  6044  6043  0 16:20 ?        00:00:00 postgres: logger process
postgres  6046  6043  0 16:20 ?        00:00:00 postgres: checkpointer process
postgres  6047  6043  0 16:20 ?        00:00:00 postgres: writer process
postgres  6048  6043  0 16:20 ?        00:00:00 postgres: wal writer process
postgres  6049  6043  0 16:20 ?        00:00:00 postgres: autovacuum launcher process   # bash-4.3$ psql  rhq --host=localhost --port=5454 --username=rhqadmin --password
Password for user rhqadmin:
psql (9.2.0)
Type "help" for help.
rhq=>

根源

  • The postgresql service was running on port 5454 instead of default port 5432.

诊断步骤

  • Collect the following commands output and check tcp port used by postgresql service

Raw

# ps -ef | grep postgres
# netstat -tulnp | grep postgres

psql: could not connect to server: No such file or directory相关推荐

  1. The server is invalid. Error occurred reading server credential. Required file or directory ‘serverO

    错误提示 改正 可以看到检测报错: The server is invalid. Error occurred reading server credential. Required file or ...

  2. 下载Python类库Server Error 404 - File

    Server Error 404 - File or directory not found. The resource you are looking for might have been rem ...

  3. Navicat客户端PostgreSQL连接报错:Could not connect to server:Connection refused(0x00002740/10061)

    Navicat客户端PostgreSQL连接报错:Could not connect to server:Connection refused(0x00002740/10061) 遇到这样的问题应该怎 ...

  4. org.apache.hadoop.ipc.Client: Retrying connect to server异常的解决

    org.apache.hadoop.ipc.Client: Retrying connect to server异常的解决 参考文章: (1)org.apache.hadoop.ipc.Client: ...

  5. INFO ipc.Client:Retrying connect to server 9000

    hadoop使用bin/start_all.sh命令之后,使用jps发现datanode无法启动 This problem comes when Datanode daemon on the syst ...

  6. Ubuntu中清理Network下Connect to Server的入口

    转自:http://blog.csdn.net/maxilbert/article/details/51126467 connect to server入口列表文件以xml格式存放在 ~/.confi ...

  7. couldn't connect to server 127.0.0.1:27017 src/mongo/

    couldn't connect to server 127.0.0.1:27017 src/mongo/ 一般这种情况就是:自己指定的数据库,所以不能.自动加载服务.第二次就不能连接了 每次启动前, ...

  8. Error: Network is unreachable. Reason: couldn‘t connect to server localhost:27017(连接mongodb数据库失败)

    1.问题连接mogodb失败 MongoDB shell version v4.2.3 connecting to: mongodb://127.0.0.1:27017/?compressors=di ...

  9. WARN RestSubmissionClient: Unable to connect to server spark://master:

    完整报错如下: $ spark-submit --class WordCountLocal --deploy-mode cluster  --driver-memory 1g --executor-m ...

  10. Php错误邮件提示linux,linux下phpmailer发送邮件出现SMTP ERROR: Failed to connect to server: (0)错误...

    在作项目的过程当中,后期客户提出了发送邮件的需求,既然客户有需求,那么没啥说的,上呗.php 通过网上的通常资料查找,PHPMailer这个插件貌似用起来不错,那就从github clone一份下来, ...

最新文章

  1. 由右移运算符引发的思考(计算机原理)
  2. 上海交大、华为海思提出X-volution,发力网络核心基础架构创新
  3. 卧槽?用 Python 还能玩 Git?
  4. verilog数字跑表设计实现与仿真
  5. 求n的阶乘的算法框图_单片机常用的14个C语言算法
  6. 最新任务型对话数据集大全
  7. 亚马逊推荐python_使用python查找amazon类别
  8. 面试算法基础及编程 第四弹 (字符串、数值类、或其他常见相关)
  9. DeFIL.org的资金池规模达168万枚FIL 已借出105万枚FIL
  10. python字符串一(字符串的书写输入输出)
  11. android 丢包率测试工具,android的ping的实现丢包率的获取
  12. (转)如何看待IT对于证券行业的价值
  13. CNN训练Cifar-10技巧
  14. c语言实现万年历程序
  15. 背景颜色、字体等的不透明区别 (opacity、transparent以及rgba的区别)
  16. 拍乐云创始人CEO赵加雨:深耕18载,打造全景式音视频服务
  17. linux 设置用户有效天数,Linux用户管理:设置用户口令的使用期限
  18. 虚拟机ubuntu系统鼠标移动消失
  19. 关于Angular 4 + ng-zorro 使用过程中遇到的问题
  20. Java基础之泛型反射

热门文章

  1. 谷粒微博学习笔记一:Utilsconstants
  2. 编译orge1.7.0
  3. uni-app入门教程
  4. 数据库课程设计(民航售票子系统含数据库代码和前端代码)
  5. java 获取IP地址 无法获取到真实的IP地址
  6. STM32控制TFTLCD显示屏(理论)
  7. SysKey 和 SAM
  8. ex is not shell_linux下环境变量详解
  9. 利用Euclid算法求解两个数的最大公约数及逆 matlab
  10. flask 数据库迁移migration