问题解决: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 accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
出现该问题的很多,以下是目前碰到的几种情况,之后碰到继续补充:
1.删除了/tmp路径中的.s.PGSQL.5432 与.s.PGSQL.5432.lock文件
解决:重启数据库 $sudo service postgresql restart
2.修改监听端口:之前用5434监听,后来改为5432,数据库启动,但是psql无法进入数据库,通过psql -p 5432可以进入。
解决:安装时配置了端口PGPORT。修改~/.bash_profile或/etc/profile文件中的端口指定。
3.修改了postgresql.conf 中的unix_socket_directories
分析见两篇博文:
http://francs3.blog.163.com/blog/static/40576727201332594924829/
http://blog.csdn.net/huguangshanse00/article/details/40413549
引用其中:
"先来看看 socket 文件 "/tmp/.s.PGSQL.1921",其中 1921 是 pg 的端口号;
socket 文件可以通过postgresql.conf 文件以下参数配置:
#unix_socket_directory = ''
#unix_socket_permissions = 0777
备注:其中参数 unix_socket_directory 用来配置 socket 文件的目录,默认是 /tmp 目录,参数
unix_socket_permissions 用来设置 socket 文件的权限。"
解决方法:指定host,用psql -h 连接
问题解决: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 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 ...
- libpqxx接口的在linux下的使用,解决psql:connections on Unix domain socket "/tmp/.s.PGSQL.5432"错误
在项目中使用postgresql数据库时要求在windows和linux双平台兼容.于是在windows下使用的接口在linux下爆出异常: psql:connections on Unix doma ...
- psql: could not connect to server: No such file or directory&&PGHOST
由于环境变量 PGHOST配置不当引起的 postgres@pgdb-> psql psql: could not connect to server: No such file or dire ...
- psql: could not connect to server: No such file or directory
postgresql报错: psql: could not connect to server: No such file or directory Is the server run ...
- 解决:error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
在使用 deamon@deamon-H55M-S2:/usr/bin$ mysqladmin -u root -p shutdown 关闭MySQL之后试图通过: deamon@deamon-H55M ...
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)-mysql.sock丢失解决方案
我们的LAMP是搭建在UBUNTU 12.04 LTS上的. LAMP是通过编译的方式进来安装的. 在一次处理意外挂机时由于未知的原因在重启后发现无法连接数据库了, 在打开网站时出现如下的的提示: E ...
- Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'解决
安装上mysql后,报 Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock',试了网上的方法 ...
- OperationalError: (2002, “Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)”)
OperationalError: (2002, “Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld ...
- Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock’
今天服务器遇到了一个很熟悉的问题 输入 #mysql -u root -p ERROR 2002 (HY000): Can't connect to local MySQL server throug ...
随机推荐
- MySQL执行外部sql脚本文件命令是报错:unknown command
使用source导入外部sql文件: mysql> source F:\php\bookorama.sql; -------------- source F: -------------- ER ...
- Oracle数据库连接、存储过程及调用
Oracle数据库连接.存储过程及调用 1. 定义一个存储过程 create or replace procedure getuser(eid in number, na out varchar, e ...
- python基本数据类型;字符串及其方法三:
###################判断类型################### ######################################################### ...
- D:Sequence Swapping
BaoBao has just found a strange sequence {<, >, <, >, , <, >} of length in his poc ...
- 系统对 Device Tree Overlays 的支持方式
问题来源: 野火 iMX 6ULL 开发板资料. https://tutorial.linux.doc.embedfire.com/zh_CN/latest/linux_basis/fire-conf ...
- java-五大内存图
jrm—Java虚拟机在进行程序运行时会向cpu申请一个内存约为10%左右,该内存被jrm分为5大区域 一:栈内存(stack)用来存储变量 当栈消失时,变量也随之消失.二:堆内存(heap)在Jav ...
- [ES6系列-04]再也不乱“哇”了:用 let 与 const 替代 var
[原创]码路工人 Coder-Power 大家好,这里是码路工人有力量,我是码路工人,你们是力量. github-pages 博客园cnblogs 今天的内容是,关于 JavaScript 中定义变量 ...
- NOIP 2017 P3959 宝藏 (状态压缩DP板子)
洛谷题目传送门!! 题目的N这么小,当然是选择用状压DP啦! 等等,我好像不会状缩.... 首先,我们当然是要写状态转移方程了!! 那么,如果我们设 f[s] 状态s下,所要的最小花费,那么很显 ...
- SD.Team回复形象小人偶
- 百万年薪架构师一文整理RabbitMQ、ActiveMQ、RocketMQ、Kafka
一般来说,大型应用通常会被拆分成多个子系统,这些子系统可能会部署在多台机器上,也可能只是一台机器的多个进程中,这样的应用就是分布式应用.在讨论分布式应用时,很多初学者会把它和集群这个概念搞混,因为从部 ...