ps auxwww | grep psql-postgres不与自制软件一起运行 [英] ps auxwww | grep psql - postgres not running with homebrew

查看:182
本文介绍了ps auxwww | grep psql-postgres不与自制软件一起运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚通过Homebrew安装了Postgres 9.2.3,启动了数据库,并输入了start命令。它说服务器正在启动,但是每当我尝试执行任何操作时,它都会告诉我:

I have installed Postgres 9.2.3 just now via Homebrew, initiated a db, and inputed the start command. It says "server starting", but whenever I try to do anything, it tells me:

psql: could not connect to server: Connection refused
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

以下是我为解决此问题已经做的事情:

Here are the things I have already done to try and fix this:

1)通过添加以下文本来修复bash配置文件中的路径: export PATH = / usr / local / bin:$ PATH

1) Fixed the path in my bash profile by adding this text: export PATH=/usr/local/bin:$PATH

2)已卸载&重新安装了pg gem

2) uninstalled & reinstalled the pg gem

3)使用了gem原始功能

3) used the gem pristine function

4)尝试卸载并重新安装了自制软件

4) tried uninstalling and reinstalling home-brew

5)删除了Mac随附的旧版本的postgres

5) removed the old version of postgres that came with the Mac

6) sudo chmod -R 777 / var / pgsql_socket /

不过,我没有做任何工作。我什至尝试使用Postgres官方安装程序和Heroku的Postgres App。

Still, nothing I do works. I have even tried using the Postgres official installer and the Postgres App from Heroku. Nothing works.

似乎我无法使postgres正常运行,因为当我运行时: ps auxw | grep postgres

It seems like I can't get postgres to run properly because when I run: ps auxw | grep postgres

我刚刚得到:

[MyName]        66744   0.0  0.0  2432768    596 s000  R+    8:47PM   0:00.00 grep postgres

没有

我注意到我的Mac用户名是Zephyr,但postgres使用的用户名是我的真实姓名。

I noticed that my username for my Mac is Zephyr, but the username postgres is using is my actual name. Could that be the issue?

我执行哪个psql ,我得到正确的路径: / usr / local / bin / psql

Which I do which psql, I get the correct path of: /usr/local/bin/psql

我一直试图使它工作数小时,但似乎没有任何解决方案连接问题。任何帮助将不胜感激!

I have been trying to get this to work for hours and nothing seems to resolve this connection issue. Any help would be appreciated!

推荐答案

我相信您需要手动设置postgresql,这在某些情况下对用户而言是很好的隐藏。
您可以尝试执行以下特定步骤,看看它是否有效(至少在我的Lion中有效)。请记住,这是我的本地设置。我从二进制文件安装了Postgresql。

I believe you need to setup postgresql manually which in some case is well hidden from user. You can try these specific steps and see if it works(At least, worked in my Lion). Bear in mind, It is my local setup. I installed Postgresql from binary.


  1. 在postgres文件夹中创建一个名为 data 的新文件夹(我的位置为 / opt / local / lib / postgresql90 / data )。确保您的 chmod 该文件夹。 数据很容易记住。

  2. 运行 initdb 来初始化postgres数据。我的是
    / opt / local / lib / postgresql90 / bin / initdb -D
    /opt/local/lib/postgresql90/data

  3. 启动服务器:
    / opt / local / lib / postgresql90 / bin / pg_ctl -D
    / opt / local / lib / postgresql90 / data开始

  1. create a new folder named data in postgres folder(mine is at /opt/local/lib/postgresql90/data). Make sure your chmod that folder. data is just simple to remember.
  2. run initdb to initialize postgres data. Mine is /opt/local/lib/postgresql90/bin/initdb -D /opt/local/lib/postgresql90/data.
  3. Start server: /opt/local/lib/postgresql90/bin/pg_ctl -D /opt/local/lib/postgresql90/data start

提示:将这些路径放入env变量中。

Tips: Put these paths into env variables.

希望它会有所帮助:)

这篇关于ps auxwww | grep psql-postgres不与自制软件一起运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆