linux– 连接psql时出现问题

linux– 连接psql时出现问题,第1张

概述我按照http://xadmin.info/?p=284中给出的说明安装了postgresql# pg_ctl -D /var/lib/pgsql/data -l pglog.log start server starting postgres@linux-p0pl:~> psql psql: could not connect to server:

我按照http://xadmin.info/?p=284中给出的说明安装了postgresql

# pg_ctl -D /var/lib/pgsql/data -l pglog.log startserver startingpostgres@linux-p0pl:~> psqlpsql: 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"?

我不知道为什么我在服务器启动时出现此错误…有人可以请帮助.

我的pglog.log文件显示以下输出:

2013-02-06 19:43:39 GMT   FATAL:  lock file "postmaster.pID" already exists2013-02-06 19:43:39 GMT   HINT:  Is another postmaster (PID 23971) running in data directory "/var/lib/pgsql/data"?2013-02-06 19:44:02 GMT   FATAL:  lock file "postmaster.pID" already exists2013-02-06 19:44:02 GMT   HINT:  Is another postmaster (PID 23971) running in data directory "/var/lib/pgsql/data"?2013-04-24 12:43:29 GMT   FATAL:  data directory "/var/lib/pgsql/data" has group or world access2013-04-24 12:43:29 GMT   DETAIL:  Permissions should be u=rwx (0700).2013-04-24 12:44:07 GMT   FATAL:  data directory "/var/lib/pgsql/data" has group or world access2013-04-24 12:44:07 GMT   DETAIL:  Permissions should be u=rwx (0700).2013-04-24 12:57:02 GMT   FATAL:  data directory "/var/lib/pgsql/data" has group or world access2013-04-24 12:57:02 GMT   DETAIL:  Permissions should be u=rwx (0700).2013-04-24 12:57:40 GMT   FATAL:  data directory "/var/lib/pgsql/data" has group or world access2013-04-24 12:57:40 GMT   DETAIL:  Permissions should be u=rwx (0700).

ps -ef | grep postgres

root     21659 21591  0 19:14 pts/0    00:00:00 grep --color=auto postgres
最佳答案/ var / lib / pgsql / data的权限和所有权应为:

# ll -d /var/lib/pgsql/datadrwx------. 15 postgres postgres 4096 Apr 24 10:27 /var/lib/pgsql/data

如果他们不是root用户:

# chmod -R 700 /var/lib/pgsql/data# chown -R postgres /var/lib/pgsql/data
总结

以上是内存溢出为你收集整理的linux – 连接psql时出现问题全部内容,希望文章能够帮你解决linux – 连接psql时出现问题所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1047826.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存