簡體   English   中英

連接到本地 postgres 數據庫時出現身份驗證錯誤

[英]Authentication error when connection to local postgres db

我目前正在努力連接到本地創建的 postgres 數據庫。 postgres 服務器在docker-compose.yml中定義如下:

version: '3.9'
services:
    postgres:
        image: bitnami/postgresql:13.4.0
        container_name: mopla-postgres
        restart: always
        environment:
            - POSTGRES_USER=mopla
            - POSTGRES_PASSWORD=develop
            - POSTGRESQL_DATABASE=mopla
        volumes:
            - mopla-postgres:/bitnami/postgresql
            - ./database_dumps:/docker-entrypoint-initdb.d
        ports:
            - 5432:5432
...

容器似乎開始:

postgresql 09:02:41.34 
postgresql 09:02:41.34 Welcome to the Bitnami postgresql container
postgresql 09:02:41.34 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-postgresql
postgresql 09:02:41.34 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-postgresql/issues
postgresql 09:02:41.35 
postgresql 09:02:41.36 INFO  ==> ** Starting PostgreSQL setup **
postgresql 09:02:41.39 INFO  ==> Validating settings in POSTGRESQL_* env vars..
postgresql 09:02:41.39 INFO  ==> Loading custom pre-init scripts...
postgresql 09:02:41.40 INFO  ==> Initializing PostgreSQL database...
postgresql 09:02:41.42 INFO  ==> pg_hba.conf file not detected. Generating it...
postgresql 09:02:41.42 INFO  ==> Generating local authentication configuration
postgresql 09:02:41.43 INFO  ==> Deploying PostgreSQL with persisted data...
postgresql 09:02:41.43 INFO  ==> Configuring replication parameters
postgresql 09:02:41.46 INFO  ==> Configuring fsync
postgresql 09:02:41.49 INFO  ==> Loading custom scripts...
postgresql 09:02:41.50 INFO  ==> Enabling remote connections
postgresql 09:02:41.51 INFO  ==> ** PostgreSQL setup finished! **
postgresql 09:02:41.55 INFO  ==> ** Starting PostgreSQL **
2022-11-28 09:02:41.571 GMT [1] LOG:  pgaudit extension initialized
2022-11-28 09:02:41.576 GMT [1] LOG:  starting PostgreSQL 13.4 on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2022-11-28 09:02:41.576 GMT [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-11-28 09:02:41.576 GMT [1] LOG:  listening on IPv6 address "::", port 5432
2022-11-28 09:02:41.580 GMT [1] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2022-11-28 09:02:41.586 GMT [85] LOG:  database system was shut down at 2022-11-28 09:02:36 GMT
2022-11-28 09:02:41.590 GMT [1] LOG:  database system is ready to accept connections

現在,當我嘗試使用密碼為“develop”的 pgadmin 連接到此數據庫時,出現身份驗證錯誤:

在此處輸入圖像描述

這是配置:

在此處輸入圖像描述

有什么明顯的我做錯了嗎? 我能做些什么來進一步調試這個問題嗎?

好吧,我明白了。

有一個正在運行的 Windows 服務也在同一端口 (5432) 上打開一個 postgres 數據庫,所以我試圖連接到錯誤的數據庫。

TCPView幫助我解決了這個問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM