首页 > 解决方案 > 在 Windows 上设置 Postgresql 10:无法在端口 5432 上启动服务器

问题描述

在 Windows 上为前端 Web 开发设置 Postgres

这不是我的专业领域(前端人员),但我需要简单地在我身边运行的 postgres 来连接我正在从事的项目的测试数据库:

在我开始我的项目之前,我必须运行它:dropdb [db_name] && createdb [db_name] && npm run migration:run:dev

当我这样做时,我得到了典型的:

dropdb: could not connect to database template1: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

这告诉我 postgres 没有在端口 5432 上运行,我在 Resource Monitor 和 pgAdmin 内部进行了验证...那),我得到:

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

我已经通过打包的安装程序安装了postgres,并且尝试了各种解决方案,例如: https://tableplus.io/blog/2018/10/how-to-start-stop-restart-postgresql-server.html 可以'不在端口 5432 上连接到 Postgresql(我不需要远程连接)

笔记)

我使用自制软件在我的 Mac 上使用 2 个命令执行此操作……但服务不适用于 linuxbrew。如果我的 mac 在同一个网络上没有问题,我认为我的网络不是问题。

我认为端口 5432 上可能正在运行某些东西,但资源监视器中似乎没有任何内容。

标签: windowspostgresqlwindows-10

解决方案


推荐阅读