pgadmin4:无法联系 postgresql 应用程序服务器。

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43211296/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 06:25:34  来源:igfitidea点击:

pgadmin4 : postgresql application server could not be contacted.

postgresqlconfigurationpgadmin-4

提问by Kaleab Woldemariam

I have installed PostgreSQL 9.6.2 on my Windows 8.1. But the pgadmin4 is not able to contact the local server. I have tried several solutions suggested here in stackoverflow, tried to uninstall and reinstall PostgreSQL 9.6.2 , tried to modify the config.py, config_distro.py, and delete the files in Roaming folder,i tried standalone pgadmin4 installation, but no success.However, in my local machine i am able to access the server using psql.exe and log as as superuser (postgres user). Can you please suggest any possible solutions to starting/running pgadmin4 ? Thank you.

我已经在 Windows 8.1 上安装了 PostgreSQL 9.6.2。但是 pgadmin4 无法联系本地服务器。我在stackoverflow中尝试了几种建议的解决方案,尝试卸载并重新安装PostgreSQL 9.6.2,尝试修改config.py、config_distro.py,并删除Roaming文件夹中的文件,我尝试了独立的pgadmin4安装,但没有成功。但是,在我的本地机器上,我可以使用 psql.exe 访问服务器并以超级用户(postgres 用户)身份登录。你能提出任何可能的解决方案来启动/运行 pgadmin4 吗?谢谢你。

采纳答案by Kaleab Woldemariam

What finally worked was downgrading to pgadminIII-v.1.22:

最终起作用的是降级到pgadminIII-v.1.22

回答by icvader

I found the same issue when upgrading to pgAdmin 4 (v1.6). On Windows I found that clearing out the C:\Users\%USERNAME%\AppData\Roaming\pgAdminfolder fixed the issue for me. I believe it was attempting to use the sessions from the prior version and was failing. I know the question was marked as answered, but downgrading may not always be an option.

升级到 pgAdmin 4 (v1.6) 时,我发现了同样的问题。在 Windows 上,我发现清除C:\Users\%USERNAME%\AppData\Roaming\pgAdmin文件夹为我解决了这个问题。我相信它试图使用先前版本中的会话并且失败了。我知道该问题已标记为已回答,但降级可能并不总是一种选择。

Note: AppData\Roaming\pgAdmin is a hidden folder.

注意:AppData\Roaming\pgAdmin 是一个隐藏文件夹。

回答by Hardik

We got the same issue. so no any change in the file. but start pgAdmin 4 using administrator.

我们遇到了同样的问题。所以文件没有任何变化。但使用管理员启动 pgAdmin 4。

The following step. 1. right click pgAdmin 4 icon 2. select "Run As Administrator"

以下步骤。1. 右键单击​​ pgAdmin 4 图标 2. 选择“以管理员身份运行”

回答by Magdalena

I had the same issue on Windows 10, with a new installation of PostgreSQL 10.

我在 Windows 10 上遇到了同样的问题,新安装了 PostgreSQL 10。

I solved it by including the path C:\PostgreSQL\10\bin ({your path to postgresql}\bin) to system environment variables.

我通过将路径 C:\PostgreSQL\10\bin({您的 postgresql 路径}\bin)包含到系统环境变量中来解决它。

To access environment variables: Control Panel > System and security > System or right click on PC, then > Advance system settings > Environment variables > System variables > Path > Edit.

要访问环境变量:控制面板 > 系统和安全 > 系统或右键单击 PC,然后 > 高级系统设置 > 环境变量 > 系统变量 > 路径 > 编辑。

回答by Joseph Daudi

if you are using Mac OS X here is a fix: Open terminal and run this command

如果您使用的是 Mac OS X,这里有一个修复:打开终端并运行此命令

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log restart

and for other OS just restart your Postgresql server, it will solve

对于其他操作系统,只需重新启动您的 Postgresql 服务器,它就会解决

Then start pgAdmin4, it will start as normal

然后启动pgAdmin4,它会正常启动

Share or comment if saved someone

如果保存了某人,请分享或评论

回答by user174487

I had same issue on windows. I had v1.6 installed as well as v2.0. Uninstalling v1.6 allowed me to login.

我在 Windows 上遇到了同样的问题。我安装了 v1.6 和 v2.0。卸载 v1.6 允许我登录。

回答by kamal09

I had the same problem, but running it as an admin worked.

我遇到了同样的问题,但以管理员身份运行它。

回答by Akshata Dabade

Deleting the contents of C:\Users\%USERNAME%\AppData\Roaming\pgAdmindirectory worked for me!

删除C:\Users\%USERNAME%\AppData\Roaming\pgAdmin目录的内容对我有用!

回答by Dizzy

I've been dealing with this for awhile (frustrating). So much that I have instructions on my desktop consolidating all of these ideas. Here is my magic combination to the solution:

我一直在处理这个问题(令人沮丧)。以至于我的桌面上都有整合所有这些想法的说明。这是我对解决方案的神奇组合:

  1. Delete from App Data C:\Users\%USERNAME%\AppData\Roaming\pgAdmin
  2. Add to Path Variables C:\Program Files\PostgreSQL\9.6\bin (I actually added it to both user and system)
  3. Right click and start as admin.
  1. 从 App Data C:\Users\%USERNAME%\AppData\Roaming\pgAdmin 中删除
  2. Add to Path Variables C:\Program Files\PostgreSQL\9.6\bin(我其实是同时添加到用户和系统的)
  3. 右键单击并以管理员身份启动。

You don't have to do this every time but when it gets out of wack try these steps.

您不必每次都这样做,但是当它变得不正常时,请尝试这些步骤。

回答by Daniel

Have you recently installed a new version of pgAdmin ?

您最近是否安装了新版本的 pgAdmin ?

This issue (and the misleading message) is simply due to the fact that old versions of pgAdmin are unable to read the settings saved by a newer version of pgAdmin !

这个问题(以及误导性消息)仅仅是因为旧版本的 pgAdmin 无法读取新版本 pgAdmin 保存的设置!

Make sure you're starting the right version of pgAdmin (your shortcuts are likely to point to the old version !) and/or uninstall the old version: the upgrade wizard doesn't do it for you !

确保您正在启动正确版本的 pgAdmin(您的快捷方式可能指向旧版本!)和/或卸载旧版本:升级向导不适合您!