加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

osx – 如何检查PostgreSQL服务器Mac OS X的状态

发布时间:2020-12-13 16:50:51 所属栏目:百科 来源:网络整理
导读:如何知道我的PostgreSQL服务器是否正在运行? 我收到此消息: [~/dev/working/sw] sudo bundle exec rake db:migrate rake aborted!could not connect to server: Connection refused Is the server running on host "localhost" and accepting TCP/IP conne
如何知道我的PostgreSQL服务器是否正在运行?

我收到此消息:

[~/dev/working/sw] sudo bundle exec rake db:migrate 
rake aborted!
could not connect to server: Connection refused
    Is the server running on host "localhost" and accepting
    TCP/IP connections on port 5432?

更新:

> which postgres
/usr/local/bin/postgres
> pg_ctl -D /usr/local/bin/postgres -l /usr/local/bin/postgres/server.log start
pg_ctl: could not open PID file "/usr/local/bin/postgres/postmaster.pid": Not a directory

更新2:

>pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting
sh: /usr/local/var/postgres/server.log: No such file or directory
检查正在运行的进程的最简单的方法:
ps auxwww | grep postgres

并查找看起来像这样的命令(您的版本可能不是8.3):

/Library/PostgreSQL/8.3/bin/postgres -D /Library/PostgreSQL/8.3/data

要启动服务器,请执行以下操作:

/Library/PostgreSQL/8.3/bin/pg_ctl start -D /Library/PostgreSQL/8.3/data -l postgres.log

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读