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

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

Problems trying to connect to local database with pgadmin4

问题

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

我已经安装了PostgreSQL。

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

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

  1. 2023-06-15 13:56:58,016: WARNING werkzeug: WebSocket transport not available. Install simple-websocket for improved performance.
  2. * Serving Flask app 'pgadmin'
  3. * Debug mode: off
  4. 2023-06-15 13:57:13,474: ERROR pgadmin: Exception when checking for update
  5. Traceback (most recent call last):
  6. File "/usr/lib/python3.10/urllib/request.py", line 1348, in do_open
  7. h.request(req.get_method(), req.selector, req.data, headers,
  8. File "/usr/lib/python3.10/http/client.py", line 1282, in request
  9. self._send_request(method, url, body, headers, encode_chunked)
  10. File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request
  11. self.endheaders(body, encode_chunked=encode_chunked)
  12. File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders
  13. self._send_output(message_body, encode_chunked=encode_chunked)
  14. File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output
  15. self.send(msg)
  16. File "/usr/lib/python3.10/http/client.py", line 975, in send
  17. self.connect()
  18. File "/usr/lib/python3.10/http/client.py", line 1447, in connect
  19. super().connect()
  20. File "/usr/lib/python3.10/http/client.py", line 941, in connect
  21. self.sock = self._create_connection(
  22. File "/usr/lib/python3.10/socket.py", line 845, in create_connection
  23. raise err
  24. File "/usr/lib/python3.10/socket.py", line 833, in create_connection
  25. sock.connect(sa)
  26. TimeoutError: timed out
  27. During handling of the above exception, another exception occurred:
  28. Traceback (most recent call last):
  29. File "/home/omistaja/pgadmin4/lib/python3.10/site-packages/pgadmin4/pgadmin/browser/__init__.py", line 433, in check_browser_upgrade
  30. response = urlopen(url, data, 5)
  31. File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
  32. return opener.open(url, data, timeout)
  33. File "/usr/lib/python3.10/urllib/request.py", line 519, in open
  34. response = self._open(req, data)
  35. File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
  36. result = this._call_chain(this.handle_open, protocol, protocol +
  37. File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
  38. result = func(*args)
  39. File "/usr/lib/python3.10/urllib/request.py", line 1391, in https_open
  40. return self.do_open(http.client.HTTPSConnection, req,
  41. File "/usr/lib/python3.10/urllib/request.py", line 1351, in do_open
  42. raise URLError(err)
  43. 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

  1. 2023-06-15 13:56:58,016: WARNING werkzeug: WebSocket transport not available. Install simple-websocket for improved performance.
  2. * Serving Flask app &#39;pgadmin&#39;
  3. * Debug mode: off
  4. 2023-06-15 13:57:13,474: ERROR pgadmin: Exception when checking for update
  5. Traceback (most recent call last):
  6. File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 1348, in do_open
  7. h.request(req.get_method(), req.selector, req.data, headers,
  8. File &quot;/usr/lib/python3.10/http/client.py&quot;, line 1282, in request
  9. self._send_request(method, url, body, headers, encode_chunked)
  10. File &quot;/usr/lib/python3.10/http/client.py&quot;, line 1328, in _send_request
  11. self.endheaders(body, encode_chunked=encode_chunked)
  12. File &quot;/usr/lib/python3.10/http/client.py&quot;, line 1277, in endheaders
  13. self._send_output(message_body, encode_chunked=encode_chunked)
  14. File &quot;/usr/lib/python3.10/http/client.py&quot;, line 1037, in _send_output
  15. self.send(msg)
  16. File &quot;/usr/lib/python3.10/http/client.py&quot;, line 975, in send
  17. self.connect()
  18. File &quot;/usr/lib/python3.10/http/client.py&quot;, line 1447, in connect
  19. super().connect()
  20. File &quot;/usr/lib/python3.10/http/client.py&quot;, line 941, in connect
  21. self.sock = self._create_connection(
  22. File &quot;/usr/lib/python3.10/socket.py&quot;, line 845, in create_connection
  23. raise err
  24. File &quot;/usr/lib/python3.10/socket.py&quot;, line 833, in create_connection
  25. sock.connect(sa)
  26. TimeoutError: timed out
  27. During handling of the above exception, another exception occurred:
  28. Traceback (most recent call last):
  29. File &quot;/home/omistaja/pgadmin4/lib/python3.10/site-packages/pgadmin4/pgadmin/browser/__init__.py&quot;, line 433, in check_browser_upgrade
  30. response = urlopen(url, data, 5)
  31. File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 216, in urlopen
  32. return opener.open(url, data, timeout)
  33. File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 519, in open
  34. response = self._open(req, data)
  35. File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 536, in _open
  36. result = self._call_chain(self.handle_open, protocol, protocol +
  37. File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 496, in _call_chain
  38. result = func(*args)
  39. File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 1391, in https_open
  40. return self.do_open(http.client.HTTPSConnection, req,
  41. File &quot;/usr/lib/python3.10/urllib/request.py&quot;, line 1351, in do_open
  42. raise URLError(err)
  43. 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:

确定