gpt4 book ai didi

postgresql - 如何从命令行运行 postgresql 并了解 Windows 中的可用数据库

转载 作者:行者123 更新时间:2023-11-29 12:35:17 26 4
gpt4 key购买 nike

我是 postgreSQL 的新手,很难在我的 Eclipse 中创建连接。

这是我到目前为止所做的:

  1. 为来自市场的 eclipse 安装了 DBeaver 插件。
  2. https://www.postgresql.org/download/windows/ 安装了 PostgreSQL 版本 10

  3. 现在我尝试在 Eclipse 中创建连接,但出现错误“ fatal error :用户“testuser”的密码验证失败

我通过类似的线程检查过( Getting authentication failed error with postgresql from command line) 但无法解决问题。

你能帮忙吗

最佳答案

要通过命令行连接 PostgreSQL,您必须安装 PostgreSQL 提供的名为“psql”的工具(如果尚未安装)。

然后使用以下命令连接到 PostgreSQL 数据库。

psql -h localhost -p 5432 -U postgres 

解释:

localhost: is the hostname of machine where PostgreSQL is installed.
5432 : is the default PostgreSQL port
postgres : is the username of to connect to DB

您的问题的解决方案:

FATAL: password authentication failed for user "testuser"

根据指定的错误消息,数据库中不存在用户或您提供的用于连接的密码不正确。重新验证您的用户名和密码,然后重试。

祝一切顺利

关于postgresql - 如何从命令行运行 postgresql 并了解 Windows 中的可用数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50258123/

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