2012-09-03 54 views
0

我在osx上,并且在创建用户postgresql时遇到问题。 当我写的命令:postgresql在osx上创建用户

createuser myapp -s 

我得到以下错误:

could not connect to database postgres: could not connect to server: No such file or directory 
Is the server running locally and accepting 
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"? 

我不知道,如果它只是PATH目录问题。

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting 

我安装了这个解决方案的PostgreSQL:http://tammersaleh.com/posts/installing-postgresql-for-rails-3-1-on-lion

感谢您的帮助和抱歉,我的英语不好。

回答

1

你确定postgres服务器正在运行吗? (使用“ps ax | grep postgres”)。它打开了一个TCP端口(默认为5432)?这是unix套接字“/var/pgsql_socket/.s.PGSQL.5432”可用,并且您是否有权读取/写入它?

此外,你可能要检查的地方Postgres的服务器本身的权限配置pg_hba.conf文件。