在尝试使用pgadmin4连接本地数据库时遇到的问题。

huangapple go评论75阅读模式
英文:

Problems trying to connect to local database with pgadmin4

问题

我是后端和PostgreSQL的新手。我正在尝试在Linux Mint上进行设置。

我已经安装了PostgreSQL。

并根据https://www.pgadmin.org/download/pgadmin-4-python/的说明设置了pgadmin4与Python。

在连接到pgadmin4并使用正确的用户名和密码登录后,我在终端中收到以下错误消息:

2023-06-15 13:56:58,016: WARNING	werkzeug:	WebSocket transport not available. Install simple-websocket for improved performance.
 * Serving Flask app 'pgadmin'
 * Debug mode: off
2023-06-15 13:57:13,474: ERROR	pgadmin:	Exception when checking for update
Traceback (most recent call last):
  File "/usr/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.10/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3.10/http/client.py", line 1447, in connect
    super().connect()
  File "/usr/lib/python3.10/http/client.py", line 941, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.10/socket.py", line 845, in create_connection
    raise err
  File "/usr/lib/python3.10/socket.py", line 833, in create_connection
    sock.connect(sa)
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/omistaja/pgadmin4/lib/python3.10/site-packages/pgadmin4/pgadmin/browser/__init__.py", line 433, in check_browser_upgrade
    response = urlopen(url, data, 5)
  File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
    result = this._call_chain(this.handle_open, protocol, protocol +
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error timed out>

pgadmin打开浏览器,有一个“Server”,但里面没有内容。
(不确定是否对任何事情有帮助,但如果我尝试创建新的服务器,它们是空的)

我该如何解决这个问题?或者你能推荐Linux Mint的更好的替代品吗?

英文:

I am new with backend and postgresql. I am trying to to set up on linux mint.

I have installed postgresql.

And set up pgadmin4 with python as instructed https://www.pgadmin.org/download/pgadmin-4-python/

After connecting to pgadmin4 and going to the local address with browser and logging in with proper username and password I get error message in terminal as follows

2023-06-15 13:56:58,016: WARNING	werkzeug:	WebSocket transport not available. Install simple-websocket for improved performance.
 * Serving Flask app &#39;pgadmin&#39;
 * Debug mode: off
2023-06-15 13:57:13,474: ERROR	pgadmin:	Exception when checking for update
Traceback (most recent call last):
  File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File &quot;/usr/lib/python3.10/http/client.py&quot;, line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File &quot;/usr/lib/python3.10/http/client.py&quot;, line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File &quot;/usr/lib/python3.10/http/client.py&quot;, line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File &quot;/usr/lib/python3.10/http/client.py&quot;, line 1037, in _send_output
    self.send(msg)
  File &quot;/usr/lib/python3.10/http/client.py&quot;, line 975, in send
    self.connect()
  File &quot;/usr/lib/python3.10/http/client.py&quot;, line 1447, in connect
    super().connect()
  File &quot;/usr/lib/python3.10/http/client.py&quot;, line 941, in connect
    self.sock = self._create_connection(
  File &quot;/usr/lib/python3.10/socket.py&quot;, line 845, in create_connection
    raise err
  File &quot;/usr/lib/python3.10/socket.py&quot;, line 833, in create_connection
    sock.connect(sa)
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/home/omistaja/pgadmin4/lib/python3.10/site-packages/pgadmin4/pgadmin/browser/__init__.py&quot;, line 433, in check_browser_upgrade
    response = urlopen(url, data, 5)
  File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 216, in urlopen
    return opener.open(url, data, timeout)
  File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 519, in open
    response = self._open(req, data)
  File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 496, in _call_chain
    result = func(*args)
  File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: &lt;urlopen error timed out&gt;

The pgamin opens browser and there is one "Server" but nothing inside it.
(Not sure if this helps with anything but if I try to create new servers they are empty)

How can I address this? Or can you recommend better alternatives to pgadmin for linux mint?

答案1

得分: 0

你收到的错误信息表明在检查 pgAdmin 更新时发生了超时。这个错误不应该影响 pgAdmin 或你的 PostgreSQL 数据库的功能。以下是一些解决此问题的步骤:

*在 pgAdmin 配置文件中禁用自动更新检查。
*检查你的网络连接,确保稳定的互联网连接。
*尝试使用不同的浏览器访问 pgAdmin 的 Web 界面。
*在 pgAdmin 中验证与你的 PostgreSQL 服务器的连接。

如果问题仍然存在,你可以尝试使用替代的 PostgreSQL 管理工具,如 DBeaver 或 Adminer。另一个选项是使用名为 psql 的命令行工具。

请记住,超时错误不应显著影响你使用 PostgreSQL 的能力。你可以尝试上述提到的步骤,或根据你的偏好探索替代工具。

英文:

The error message you received indicates a timeout while checking for updates in pgAdmin. This error should not affect the functionality of pgAdmin or your PostgreSQL database. Here are some steps to address the issue:

*Disable automatic update checks in the pgAdmin configuration file.
*Check your network connectivity to ensure a stable internet connection.
*Try using a different browser to access pgAdmin's web interface.
*Verify the connection to your PostgreSQL server in pgAdmin.

If the issue persists, you can try alternative PostgreSQL administration tools like DBeaver or Adminer. Another option is to use the command-line tool called psql.

Remember, the timeout error should not significantly impact your ability to work with PostgreSQL. You can try the steps mentioned or explore alternative tools based on your preference.

huangapple
  • 本文由 发表于 2023年6月16日 01:05:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76483975.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定