在我做了brew更新和brew升级之后,我的postgres遇到了一些问题.我试图卸载postgres并重新安装,但它也没有用.
这是错误消息.(当我尝试执行rake db:migrate时,我也收到此错误消息)
$ psql
psql: 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"?
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
Mac版:山狮.
自制版:0.9.3
postgres版本:psql(PostgreSQL)9.2.1
这就是我所做的.
12:30 ~/D/works$ brew uninstall postgresql
Uninstalling /usr/local/Cellar/postgresql/9.2.1...
12:31 ~/D/works$ brew uninstall postgresql
Uninstalling /usr/local/Cellar/postgresql/9.1.4...
12:31 ~/D/works$ psql --version
bash: /usr/local/bin/psql: No such file or directory
12:33 ~/D/works$ brew install postgresql
==> Downloading http://ftp.postgresql.org/pub/source/v9.2.1/postgresql-9.2.1.tar.bz2
Already downloaded: /Library/Caches/Homebrew/postgresql-9.2.1.tar.bz2
......
......
==> Summary
/usr/local/Cellar/postgresql/9.2.1: 2814 files, 38M, built in …Run Code Online (Sandbox Code Playgroud) 重启我的Mac后,我遇到了可怕的Postgres错误:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Run Code Online (Sandbox Code Playgroud)
发生这种情况的原因是因为我的macbook完全因为一个无关的问题而冻结,我不得不使用电源按钮进行硬重启.重新启动后,由于此错误,我无法启动Postgres.
我最近升级到OSX 10.7,此时我的rails安装在尝试连接到psql服务器时完全被堵塞了.当我从命令行使用时
psql -U postgres
Run Code Online (Sandbox Code Playgroud)
它工作得很好,但是当我尝试使用相同的用户名和密码运行rails服务器或控制台时,我收到此错误
...activerecord-3.0.9/lib/active_record/connection_adapters/postgresql_adapter.rb:950:in `initialize': could not connect to server: Permission denied (PGError)
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
Run Code Online (Sandbox Code Playgroud)
任何可能发生的想法都会非常有用!谢谢!
我刚刚使用OS X Server将我的MacMini服务器从Lion Server升级到Mountain Lion.我在去年第一次安装Lion Server时遇到了与PostgreSQL相同的问题.
当我尝试做任何类型的PostgreSQL终端命令时,我得到了许多多年来得到的以下臭名昭着的错误消息:
psql: 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"?
Run Code Online (Sandbox Code Playgroud)
当我收到错误时,我试图更改_postgres的密码.我尝试了几个命令,但得到了同样的错误.我只是重新启动了我的服务器,但没有运气.我以root身份登录以查看/ var/pgsql_socket,该文件夹为空.文件夹/ var/pgsql_socket_alt也是空的.
我在网上查了一下这个.然而,我所阅读的所有解决方案,包括Stack Overflow,都建议删除并重新安装PostgreSQL.我不知道,但这似乎不是一个合理的选择,因为Server App上的几个选项使用PostgreSQL.我联系了Apple Enterprise Support(没有协议),我被告知我的问题必须由开发人员解决,这将投入695美元.
我现在有一个网站,因为我无法重建它.此时我不知道在哪里寻求帮助.我会继续在线查看我是否能找到一些东西.但是我希望有人可以快速给我一个答案,这样我就可以重建我的数据库了.
更新:12/13/2012 15:33 GMT-6
这是ps auwwx | grep postg的输出:
_postgres 28123 0.0 0.1 2479696 7724 ?? Ss 3:01PM 0:00.04 /Applications/Server.app/Contents/ServerRoot/usr/bin/postgres_real -D /Library/Server/PostgreSQL For Server Services/Data -c listen_addresses= -c log_connections=on -c log_directory=/Library/Logs/PostgreSQL -c log_filename=PostgreSQL_Server_Services.log -c log_line_prefix=%t -c log_lock_waits=on -c log_statement=ddl -c logging_collector=on …Run Code Online (Sandbox Code Playgroud) 我已经安装了Postgresql,然后在我的本地Mac OSX Mountain Lion上运行了一堆rails应用程序并创建了数据库等.过了一段时间,当我启动pgAdminIII并尝试启动数据库服务器时,我遇到了这个错误:

快速谷歌显示这篇文章.更多的浏览指出,可能存在某种postmaster.pid文件,这可能是导致这种情况的根本原因.如果我删除那些东西就没事了.
但是,在我删除计算机上的东西之前,我想确保我以系统的方式调试它,这不会导致更多的问题.
我在删除该文件之前读到的某个地方,我需要运行这个命令:
ps auxw | grep post
Run Code Online (Sandbox Code Playgroud)
如果我没有得到任何结果,可以删除该文件.否则不是.好吧,我得到了这个命令的结果:
AM 476 0.0 0.0 2423356 184 s000 R+ 9:28pm 0:00.00 grep post
Run Code Online (Sandbox Code Playgroud)
所以现在当然我非常困惑.
所以我该怎么做?
这是我的postgres服务器错误日志的一部分:
FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster (PID 171) running in data directory "/usr/local/var/postgres"?
Run Code Online (Sandbox Code Playgroud)
Postgresql仍然没有运行,仍然得到相同的错误,没有任何改变.我太老了,没有检查SO就删除了东西.
有些专家可以指导一个菜鸟.
谢谢
我不知道如何解决这个问题
我不知道为什么我在尝试时遇到此错误runserver:
Performing system checks...
System check identified no issues (0 silenced).
Unhandled exception in thread started by <function wrapper at 0x1085589b0>
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 222, in wrapper
fn(*args, **kwargs)
File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 107, in inner_run
self.check_migrations()
File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 159, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/Library/Python/2.7/site-packages/django/db/migrations/executor.py", line 17, in __init__
self.loader = MigrationLoader(self.connection)
File "/Library/Python/2.7/site-packages/django/db/migrations/loader.py", line 49, in __init__
self.build_graph()
File "/Library/Python/2.7/site-packages/django/db/migrations/loader.py", line 184, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/Library/Python/2.7/site-packages/django/db/migrations/recorder.py", …Run Code Online (Sandbox Code Playgroud) brew安装postgresql
初始化...
[~] initdb
The files belonging to this database system will be owned by user "pma".
This user must also own the server process.
The database cluster will be initialized with locales
COLLATE: C
CTYPE: UTF-8
MESSAGES: C
MONETARY: C
NUMERIC: C
TIME: C
The default database encoding has accordingly been set to UTF8.
initdb: could not find suitable text search configuration for locale UTF-8
The default text search configuration will be set to "simple".
creating directory /Users/pma/.pgdata ... …Run Code Online (Sandbox Code Playgroud) 我试图在我的mac(10.7 Lion)上为本地的rails应用程序设置postgres.
我安装了postgresapp并启动它,我现在在我的状态栏中有一只大象告诉我postgres正在运行.
我可以通过以下方式达到:
psql -h localhost
Run Code Online (Sandbox Code Playgroud)
但是,当我只是运行时,psql我得到这个错误:
psql:无法连接到服务器:Permission denied服务器是否在本地运行并接受Unix域套接字"/var/pgsql_socket/.s.PGSQL.5432"上的连接?
我把它说:
PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
Run Code Online (Sandbox Code Playgroud)
在~/.bashrc并开辟了一个新的终端.但没有骰子.
当我跑步时,which psql我得到了/usr/bin/psql
不确定该怎么做..我对unix系统还是个新手.我应该符号链接/usr/bin/psql到/Applications/Postgres.app/Contents/MacOS/bin/psql?
我在计算机上安装Postgresql时遇到了很多麻烦.
我有一个Rails应用程序,我部署到Heroku并希望在我的本地计算机上使用Postgresql.在我下载Postgres.app但从未真正使用它之前,最近卸载它认为它可能会导致一些问题.
我安装Postgres,每次运行rake db:create:all,我都会收到以下错误:
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"?
Run Code Online (Sandbox Code Playgroud)
我用谷歌搜索并尝试了一些东西,但还是没能弄明白,并认为我可能最终得到一些个人帮助.
当我运行哪个psql时:
/usr/local/bin/psql
Run Code Online (Sandbox Code Playgroud)
我已经尝试卸载Postgres,卸载pg并重新安装它但是没有任何东西可以工作.
有什么见解吗?谢谢.
我无法在Mac OS X上重新启动postgres服务器.我该如何解决这个问题?
试过两种方式:
pg_ctl restart返回:
pg_ctl: PID file "usr/local/var/postgres:/postmaster.pid" does not exist
Is server running?
starting server anyway
pg_ctl: could not read file "usr/local/var/postgres:/postmaster.opts"
Run Code Online (Sandbox Code Playgroud)
服务器不会重新启动
pg_ctl -D/usr/local/var/postgres restart导致:
pg_ctl: PID file "/usr/local/var/postgres/postmaster.pid" does not exist
Is server running?
starting server anyway
server starting
LOG: could not bind IPv4 socket: Address already in use
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
LOG: could not bind IPv6 socket: Address already in …Run Code Online (Sandbox Code Playgroud) 在使用postgres和mac 10.8搜索所有这些问题后需要帮助
我通过自制软件安装了pg(尝试使用heroku应用程序,但没有运气)
which psql --> /usr/local/bin/psql
psql --version --> psql (PostgreSQL) 9.2.4
Run Code Online (Sandbox Code Playgroud)
当启动rails服务器时我得到了 Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
我什么时候pg_ctl -D /usr/local/var/postgres -l logfile start得到server starting
当我跑步时,psql我得到了Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
任何的想法?