gpt4 book ai didi

windows - 无法联系 pgAdmin 4 服务器

转载 作者:行者123 更新时间:2023-12-04 15:19:24 27 4
gpt4 key购买 nike

我已经安装了 PostgreSQL 12 和 pgAdmin 4。当我尝试运行 pgAdmin 4 时,我收到一个 fatal error “无法联系 pgAdmin 4 服务器”。我尝试以管理员身份运行它,删除“C:\Users\User\AppData\Roaming\pgAdmin”中的文件并将“C:\Program Files\PostgreSQL\12\bin”添加到系统环境变量中。我不知道我还能做什么。我确信 PostgreSQL 服务器正在运行,因为它在 services.msc 的服务正在运行。
这是运行 pgAdmin4 的日志。我可以看到这里有问题,但我不知道如何解决这个问题:

Traceback (most recent call last):
File "C:/Program Files/pgAdmin 4/v4/web/pgAdmin4.py", line 217, in <module>
main()
File "C:/Program Files/pgAdmin 4/v4/web/pgAdmin4.py", line 199, in main
app.run(
File "C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages\flask\app.py", line 943, in run
run_simple(host, port, self, **options)
File "C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages\werkzeug\serving.py", line 1052, in run_simple
inner()
File "C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages\werkzeug\serving.py", line 996, in inner
srv = make_server(
File "C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages\werkzeug\serving.py", line 847, in make_server
return ThreadedWSGIServer(
File "C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages\werkzeug\serving.py", line 740, in __init__
HTTPServer.__init__(self, server_address, handler)
File "C:/Program Files/pgAdmin 4/v4/venv/Lib\socketserver.py", line 452, in __init__
self.server_bind()
File "C:/Program Files/pgAdmin 4/v4/venv/Lib\http\server.py", line 140, in server_bind
self.server_name = socket.getfqdn(host)
File "C:/Program Files/pgAdmin 4/v4/venv/Lib\socket.py", line 756, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb3 in position 5: invalid start byte
这是另一个 .log 文件:
2020-08-31 17:15:12: Checking for system tray...
2020-08-31 17:15:12: Starting pgAdmin4 server...
2020-08-31 17:15:12: Creating server object, port:52967, key:459b0c86-b99e-46f0-9070-55554b9621d3, logfile:C:/Users/user/AppData/Local/pgadmin4.d41d8cd98f00b204e9800998ecf8427e.log
2020-08-31 17:15:12: Python Path: C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages;C:/Program Files/pgAdmin 4/v4/venv/DLLs;C:/Program Files/pgAdmin 4/v4/venv/Lib
2020-08-31 17:15:12: Python Home: C:/Program Files/pgAdmin 4/v4/venv
2020-08-31 17:15:12: Initializing Python...
2020-08-31 17:15:12: Python initialized.
2020-08-31 17:15:12: Adding new additional path elements
2020-08-31 17:15:12: Redirecting stderr...
2020-08-31 17:15:12: stderr redirected successfully.
2020-08-31 17:15:12: Initializing server...
2020-08-31 17:15:12: Webapp Path: C:/Program Files/pgAdmin 4/v4/web/pgAdmin4.py
2020-08-31 17:15:12: Server initialized, starting server thread...
2020-08-31 17:15:12: Open the application code and run it.
2020-08-31 17:15:12: Set the port number, key and force SERVER_MODE off
2020-08-31 17:15:12: PyRun_SimpleFile launching application server...
2020-08-31 17:15:13: Application Server URL: http://127.0.0.1:52967/?key=459b0c86-b99e-46f0-9070-55554b9621d3
2020-08-31 17:15:13: The server should be up. Attempting to connect and get a response.
2020-08-31 17:15:21: Failed to launch the application server, server thread exiting.
如果你知道我能做什么,请帮助我。

最佳答案

在自己处理了这个问题后,错误和堆栈跟踪与给定的完全相同,我终于找到了解决方案。
我的电脑的主机名是导致问题的原因,因为它包含一个非 ASCII 字符的“æ”。所以主机名,如果用于 pgadmin,显然只能包含 ASCII 字符。
解决方案是将主机名更改为不带 'æ' 的名称(就我而言是 æ -> ae)。主机名是电脑的实际名称,在系统属性下找到并编辑(此电脑然后是属性)。

关于windows - 无法联系 pgAdmin 4 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63673779/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com