我刚刚买了一个新的Postico专业版(Catalina10.15.5),并使用了我的旧MacBook的time Machine,它使用的是相同的操作系统(10.15.5),传输过程很好,但现在当我第一次使用MacBook时,我无法连接到本地主机。我得到一个错误。
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上的。
会不会是Postico无法连接到我新Mac上的本地主机的问题?我也使用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问题。
发布于 2020-06-09 01:20:04
此时不要运行initdb。如果$PGDATA目录中有文件,它将拒绝运行。您需要检查服务器是否正在运行。有关更多信息,请参阅此SO答案:How to start PostgreSQL server on Mac OS X?
如果服务器正在运行,则检查listen_addresses设置为:https://www.postgresql.org/docs/12/runtime-config-connection.html的postgresql.conf
要排除主机问题,请尝试连接-h 127.0.0.1或::1 (如果尚未连接)。
https://stackoverflow.com/questions/62267170
复制相似问题