PostgreSQL 错误:无法连接到服务器:连接被拒绝 (0x0000274D/10061)

时间:2021-04-30 08:12:57

标签: postgresql

我在尝试创建和连接 PostgreSQL 服务器时遇到以下问题:

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5678? 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 5678?

我尝试了许多可能的解决方案,但我想我还缺少其他东西。

我的文件夹“C:\Program Files\PostgreSQL\12\data”是空的,在 Windows 服务应用中,服务“postgresql-x64-12”不存在。

提前致谢。

编辑:

原始错误消息说(德语):

C:\WINDOWS\system32>initdb -U postgres -W C:\Users\woelf\PostgreSQLData
Die Dateien, die zu diesem Datenbanksystem gehören, werden dem Benutzer
»woelf« gehören. Diesem Benutzer muss auch der Serverprozess gehören.

Der Datenbankcluster wird mit der Locale »German_Germany.1252« initialisiert werden.
Die Standarddatenbankkodierung wurde entsprechend auf »WIN1252« gesetzt.
Die Standardtextsuchekonfiguration wird auf »german« gesetzt.

Datenseitenprüfsummen sind ausgeschaltet.

Geben Sie das neue Superuser-Passwort ein:
Geben Sie es noch einmal ein:

berichtige Zugriffsrechte des bestehenden Verzeichnisses C:/Users/woelf/PostgreSQLData ... ok
erzeuge Unterverzeichnisse ... ok
wähle Implementierung von dynamischem Shared Memory ... windows
wähle Vorgabewert für max_connections ... Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
20
wähle Vorgabewert für shared_buffers ... Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
400kB
wähle Vorgabewert für Zeitzone ... CET
erzeuge Konfigurationsdateien ... ok
führe Bootstrap-Skript aus ... Das System kann den angegebenen Pfad nicht finden.
Kindprozess hat mit Code 1 beendet
initdb: entferne Inhalt des Datenverzeichnisses »C:/Users/woelf/PostgreSQLData«

当我将系统语言设置为英语时的错误消息说:

C:\WINDOWS\system32>initdb -U postgres -W C:\Users\woelf\PostgreSQLData
The files belonging to this database system will be owned by user "woelf".
This user must also own the server process.

The database cluster will be initialized with locale "English_United States.1252".
The default database encoding has accordingly been set to "WIN1252".
The default text search configuration will be set to "english".

Data page checksums are disabled.

Enter new superuser password:
Enter it again:

fixing permissions on existing directory C:/Users/woelf/PostgreSQLData ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... windows
selecting default max_connections ... The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
20
selecting default shared_buffers ... The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
400kB
selecting default time zone ... CET
creating configuration files ... ok
running bootstrap script ... The system cannot find the path specified.
child process exited with exit code 1
initdb: removing contents of data directory "C:/Users/woelf/PostgreSQLData"

0 个答案:

没有答案