gpt4 book ai didi

postgresql - 无法删除 staging_database:#
转载 作者:太空宇宙 更新时间:2023-11-03 14:58:44 25 4
gpt4 key购买 nike

对于我正在使用的系统,当我尝试删除数据库并重新创建它时,我遇到了粘贴在标题上的问题。更具体地说,这正是我面临的问题:

Couldn't drop staging_databse : #<PG::ConnectionBad: FATAL: no pg_hba.conf entry for host xxx.xx.xxxx.xxx, user "ruby", database "postgres", SSL off

我对这个问题做了一些研究,看来解决方案就是打开 SSL。我在 pg_hba.conf 上查阅了 Postgresql 文档,但找不到此配置文件。

我输入 locate postgresql,我注意到系统上安装了 postgresql-client-9.2。根据我的判断,我不会找到这个 pg_hba.conf 文件,因为客户端没有它。我还根据官方文档在 SSL 上查找了 postgresql.conf 文件,但该文件也不包含在内。

最后,文档向我展示了 pgsql 9.2 客户端的配置选项,如下所示:

libpq reads the system-wide OpenSSL configuration file. By default, 
this file is named openssl.cnf and is located in the directory reported by
openssl version -d. This default can be overridden by setting environment
variable OPENSSL_CONF to the name of the desired configuration file.

但是,这也不在我的系统中。我已经运行了 linux find 命令,但该文件似乎不存在。我的联赛用完了,我偷偷怀疑我忽略了一些非常简单的事情。我还有其他线索可以继续吗?谢谢。

最佳答案

基于此消息和上下文的其余部分:

FATAL: no pg_hba.conf entry for host xxx.xx.xxxx.xxx, user "ruby", database "postgres", SSL off

看起来合理的是:

  • 您正在连接到您不管理的远程 PostgreSQL 实例,因为您是开发人员,而不是管理员。
  • 数据库管理层尝试连接到名为 postgres 的数据库,以便删除另一个数据库 (staging_database)。这确实是必要的,因为当我们连接到数据库时我们不能删除它(事实上,当任何人连接到它时都不能删除数据库)。
  • 远程 pg_hba.conf 建立的管理策略不允许您的登录名和 IP 地址一起连接到名为 postgres 的数据库

这些事实结合在一起意味着您缺少删除数据库的必要权利,即使是间接的。

此时您想将问题提交给负责该 PostgreSQL 服务器的管理员。

关于postgresql - 无法删除 staging_database:#<PG::ConnectionBad: FATAL: no pg_hba.conf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25693266/

25 4 0

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