I got this error message when i ran: npx prisma studio:
Can't reach database server at localhost:5432
Please make sure your database server is running at localhost:5432.
what i did already:
- made sure docker with psql is running with: docker ps
- validate my database url: DATABASE_URL="postgres://postgres:postgres@localhost:5432/median-db"
- logged docker:
postgres-1 | postgres-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization postgres-1 | postgres-1 | 2024-01-18 12:02:48.306 UTC [1] LOG: starting PostgreSQL 13.5 (Debian 13.5-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit postgres-1 | 2024-01-18 12:02:48.307 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgres-1 | 2024-01-18 12:02:48.307 UTC [1] LOG: listening on IPv6 address "::", port 5432 postgres-1 | 2024-01-18 12:02:48.311 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres-1 | 2024-01-18 12:02:48.317 UTC [26] LOG: database system was shut down at 2024-01-18 12:02:46 UTC postgres-1 | 2024-01-18 12:02:48.324 UTC [1] LOG: database system is ready to accept connections - restart docker:
docker compose down and up again