postgresql出现Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.

在psql进入数据库出现以下错误
[postgres@pg data]$ psql
psql: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
	
可能出现的原因1:
tmp目录的全权限被修改过
[root@pg ~]# chown -R postgres:postgres /tmp	
可能原因2:
修改过以下参数
unix_socket_directories = '/home/postgres/'       # comma-separated list of directories
                                        # (change requires restart)
unix_socket_group = ''                 # (change requires restart)
unix_socket_permissions = 0777         # begin with 0 to use octal notation

更改过存放文件的位置目录(默认是tmp)
重启数据库后psql进入数据库出现开始的错误
这是我们有几个方法进入数据库
一个是指定文件的位置
[postgres@pg data]$ psql -h /home/postgres/
psql (9.4.4)
Type "help" for help.

postgres=# 

另一个是指定主机
	
[postgres@pg data]$ psql -h 127.0.0.1
psql (9.4.4)
Type "help" for help.

postgres=# 

有时候如果你不小心删除了wal日志,导致数据库无法读取wal日志也会出现这种错误,这时候如果你开启了归档还好办,没有话,只能重装数据库了。

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值