skip to Main Content

Can anyone help me please with this?

what I run:

docker run --name pgres --rm 
    -e POSTGRES_USER=uzer 
    -e POSTGRES_PASSWORD=1234 
    -e POSTGRES_DB=sample_db 
    -p 5432:5432 postgres:14.1

but I cannot connect to that:
pgAdmin - Register Server Modal

even Nothing happens in the log:

waiting for server to shut down...2024-07-24 18:07:19.272 UTC [48] LOG:  received fast shutdown request
.2024-07-24 18:07:19.273 UTC [48] LOG:  aborting any active transactions
2024-07-24 18:07:19.275 UTC [48] LOG:  background worker "logical replication launcher" (PID 55) exited with exit code 1
2024-07-24 18:07:19.275 UTC [50] LOG:  shutting down
2024-07-24 18:07:19.284 UTC [48] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

2024-07-24 18:07:19.396 UTC [1] LOG:  starting PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2024-07-24 18:07:19.397 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-24 18:07:19.397 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-24 18:07:19.398 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-24 18:07:19.401 UTC [62] LOG:  database system was shut down at 2024-07-24 18:07:19 UTC
2024-07-24 18:07:19.405 UTC [1] LOG:  database system is ready to accept connections




2

Answers


  1. Is the password correct for the user ?

    🐘$: psql -d sample_db -U uzer -p 5432
    Password for user uzer: 
    psql: error: FATAL:  password authentication failed for user "uzer"
    
    Login or Signup to reply.
  2. I see 2 possible problems:

    1. In the app you are using to connect to the database, you shall use the name of the database you created. In your case is sample_db. Probably the connection is trying to be done to postgres database and therefore you cannot connect.
    2. You cannot reach localhost, in this case depending on your OS you have to configure it, so it recognizes localhost and forward the requests to your computer.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search