【问题标题】:postgres server running in local host, but postico, metasploit can't access to itpostgres 服务器在本地主机上运行,​​但是 postico、metasploit 无法访问它
【发布时间】:2020-09-27 17:16:15
【问题描述】:

我刚买了一台新的 MacBook Pro (Catalina 10.15.5) 并使用了使用相同操作系统 (10.15.5) 的旧 MacBook 的 Time Machine,并且传输顺利,但现在第一次使用 Postico 时,我无法连接到本地主机。我收到一个错误。

    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

我表明我已经安装了 postgressql,或者至少在我的 brew 列表中。我不确定是否需要在新 MacBook 上运行此命令 initdb /usr/local/var/postgres,因为我几乎在新 MacBook 上以恢复模式复制旧 MacBook 中的硬盘?

问题是 Postico 无法连接到我的新 Mac 上的 localhost 吗?我也使用 Metasploit,但我也遇到了连接错误。

[-] * WARNING: No database support: could not connect to server: Connection refused
    Is the server running on host "127.0.0.1" and accepting
    TCP/IP connections on port 5432?

[-] ***

现在,我只是想解决 Postico 问题和任何 postgressql 问题。稍后我会解决 metasploit 问题。

【问题讨论】:

    标签: postgresql localhost macos-catalina metasploit postico


    【解决方案1】:

    此时不要运行 initdb。如果 $PGDATA 目录中有文件,它将拒绝运行。您需要检查服务器是否实际运行。有关更多信息,请参阅此 SO 答案: How to start PostgreSQL server on Mac OS X?

    如果服务器正在运行,则检查 postgresql.conf 中的 listen_addresses 设置: https://www.postgresql.org/docs/12/runtime-config-connection.html

    要排除主机问题,请尝试使用 -h 127.0.0.1 或 ::1 连接(如果您还没有)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-17
      • 2014-11-29
      • 2015-06-03
      • 2020-07-12
      • 1970-01-01
      • 1970-01-01
      • 2018-05-20
      相关资源
      最近更新 更多