简体   繁体   English

DBeaver localhost PostgreSQL 连接被拒绝

[英]DBeaver localhost PostgreSQL connection refused

I just installed DBeaver on my personal computer and am trying to create a PostgreSQL database.我刚刚在我的个人计算机上安装了 DBeaver,并正在尝试创建一个 PostgreSQL 数据库。

I entered the following in the Connect to database window:我在“连接到数据库”窗口中输入了以下内容:

  • Host: localhost主机:本地主机
  • Port: 5432端口:5432
  • Database: postgres数据库:postgres
  • User: postgres用户:postgres

Those values were all pre-filled defaults, so I left them and clicked the Test Connection... button.这些值都是预先填充的默认值,所以我留下它们并单击“测试连接...”按钮。

When I click the Test button an error window opens, saying, "Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. Connection refused: connect"当我单击“测试”按钮时,会打开一个错误窗口,提示“与 localhost:5432 的连接被拒绝。检查主机名和端口是否正确,并且邮局主管正在接受 TCP/IP 连接。连接被拒绝:连接”

I tried setting my own db name and credentials, but get the same results.我尝试设置自己的数据库名称和凭据,但得到相同的结果。

How do I set up a local PostgreSQL database in DBeaver?如何在 DBeaver 中设置本地 PostgreSQL 数据库?

DBeaver does not allow to setup a local PostgreSQL server or instance: it allows to connect to an existing server or instance. DBeaver 不允许设置本地 PostgreSQL 服务器或实例:它允许连接到现有服务器或实例。 If the PostgreSQL instance does not exist you should install PostgreSQL binaries and create a new database instance with initdb .如果 PostgreSQL 实例不存在,您应该安装 PostgreSQL 二进制文件并使用initdb创建一个新的数据库实例。

如果您的操作系统是 Windows 10 Home,则必须使用192.168.99.100而不是localhost

Answer from here - https://www.reddit.com/r/dbeaver/comments/fi8h0q/new_dbeaver_install_how_to_set_up_first/ .从这里回答 - https://www.reddit.com/r/dbeaver/comments/fi8h0q/new_dbeaver_install_how_to_set_up_first/

Dbeaver is just a client to the server. Dbeaver 只是服务器的客户端。 You need to setup the server itself first.您需要先设置服务器本身。

https://www.postgresql.org/ https://www.postgresql.org/

Download and setup the server then you can connect to it with DBeaver and do what you want to do.下载并设置服务器,然后您可以使用 DBeaver 连接到它并做您想做的事情。

我也一样,然后我记得我没有用脚本启动postgres

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM