postgresql 出现 Is the server running locally and accepting connections on Unix domain socket "/var/r
最新推荐文章于 2023-06-23 10:24:18 发布
最新推荐文章于 2023-06-23 10:24:18 发布
postgresql 出现 Is the server running locally and accepting connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
有可能/var/lib/postgresql 文件夹权限被无意中更改
解决方案1:
sudo chown -R postgres:postgres /var/lib/postgresql
来源:
http://ubuntuforums.org/showthread.php?t=2257724
解决方案2:
sudo ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432 #创建软连接
sudo vim /etc/postgresql/9.4/main/pg_hba.conf #修改配置文件
将 local all postgres peer 中的peer
local all postgres turst
解决方案来源:
http://stackoverflow.com/questions/28925848/error-with-postgresql-datababse-is-the-server-running-locally-and-accepting-co
netstat -nlp | grep 5432 ##查看是否成功
推荐第二种,第一种成功一次 ,但第二天还是出现同样的问题。
在psql进入数据库
出现
以下错误
[postgres@pg data]$ psql
psql: could not connect to
server
: No such file or directory
Is the
server
running
local
ly
and
accep
ting
connection
s on
Unix
dom
ain
socket
"/tmp/.s.PGSQL.54
$ psql -h 10.0.4.13 -U postgres -d postgres -p5432
psql: error: could not connect to
server
:
Connection
refused
Is the
server
running
on host "10.0.4.13" and
accep
ting
TCP/IP
connection
s on...
(4)修改postgres数据库监听
socket
目录(这一步 非必须步骤,使用默认的/tmp/.s.PGSQL.5432也可以,使用默认的/tmp/.s.PGSQL.5432时,直接用psql就能登录,不用加参数h来指定
socket
监听位置),相关目录需要给权限。psql -h /tmp/postgrev15_
socket
/.s.PGSQL.5432 (修改了
socket
监听的目录,故登录时需要制定
socket
)(6)用test用户使用
socket
连接数据库。(1)首先在数据库中创建一个test用户。
Is the
server
running
on host "
local
host" (::1) and
accep
ting
TCP/IP
connection
s on port 5432?
could not connect to
server
:
Connection
refused Is the
server
running
on host "127.0.0.1" and
accep
ting
TCP/IP
connection
s on port 5432?
无法连接到服务器:连接被拒绝服务器是否在主.
错误提示:
psql: could not connect to
server
: No such file or directoryIs the
server
running
local
ly
and
accep
ting
connection
s on
Unix
dom
ain
socket
"/
var
/run/
postgresql
/.s.PGSQL.5432"?
出现
该问题的很...
1、问题描述
在修改
postgresql
.conf文件中"
unix
_
socket
_directories" 值时,重启数据库生效,但是必须制定 -h /xx/xx来使用 the
Unix
dom
ain
socket
连接数据库。
测试如下:
[wln@
local
host postgres9.3]$ cat data/
postgresql
.conf | grep
unix
_
socket
<!--google_ad_client = "pub-5873492303276472";/* 728x90, 创建于 08-7-29 */google_ad_slot = "7502041044";google_ad_width = 728;google_ad_height = 90;// --><!--google_ad_client = "p
执行psql时遇到,
connection
to
server
on
socket
"/
var
/run/
postgresql
/.s.PGSQL.5432" failed。
could not connect to
server
:
Connection
refused (0x0000274D/10061) Is the
server
running
on host"
local
host"(::1)and
accep
ting
TCP/IP
connection
on port 5434?..
打开
postgresql
输入密码连接不上报错
这种情况大概率是数据库没有启动
启动一下就好了
打开任务管理器-----服务----找到
postgresql
服务-----右键开始
然后重开p
$ psql postgres
psql:
error: could not connect to
server
: could not connect to
server
: No such file or directory
Is the
server
running
local
ly
and
accep
ting
connection
s on
Unix
dom
ain
socket
"/
var
/run/
postgresql
/.s.PGSQL.5432
cd /
var
/lib/cloudera-scm-
server
-db/data/
[root@ambari
server
pg_log]# service cloudera-scm-
server
-db restart
wai
ting
for se
完整报错如下:
django.db.utils.OperationalError: could not connect to
server
:
Connection
refused
Is the
server
running
on host "
local
host" (127.0.0.1) and
accep
ting
TCP/IP
connection
s on por...