Could not connect to server: Connection refused from both port 5432 and 54320 depends on what I'm doing

is the server running on host and accepting tcp/ip connections on port 5432
postgres connection refused
could not connect to postgresql server localhost
docker-compose postgres connection refused
docker postgres connection refused localhost
psql error could not connect to server
docker-compose postgres could not connect to server: no such file or directory
docker dial tcp 127.0 01 5432: connect: connection refused

I'm doing a laravel project, when migrate with port 5432 it shows me could not connect error so I change to port 54320 in .env file. Everything seems okay till I make some test query and Homestead.test/api/test displays could not connect error again. Switch back to 5432 and everything is okay. I can only migrate or seed with port 54320 and make some api query with 5432. Here is my .env file.

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=54320
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

Set these 2 environment variables like this:

DB_HOST=localhost
DB_PORT=5432

Run this for refreshing the env config:

php artisan config:cache

And try again. If you'll get an error, then we'll think about that.

“localhost” (::1) and accepting TCP/IP connections on port 5432?, You most likely ran out of battery and your postgresql server didn't shutdown correctly. The easiest workaround is to download the official postgresql app and  If that connection string was for Port 5433 then the connection would be refused. Now, on my local machine (outside the context of Docker), if I spin up PgAdmin, I am able to connect to app.tests.postgres directly by connecting to localhost:5433 with the same credentials, however, localhost:5432 will not connect.


I solved the problem by changing port forwarding from

54320(host) => 5432(guest) to 5432(host) => 5432(guest)

in Oracle VM VirtualBox Manager. Have no idea why default settings not working in the first place, but at least I no longer need to flip port back and forth.

psql: could not connect to server: connection refused, common: psql: could not connect to server: Connection refused Is the server running on host "<your host>" and accepting TCP/IP connections on port 5432 . PG::ConnectionBad: could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? could not connect to server: Cannot assign requested address Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?


Postgres connection refused docker, Hi, I use docker-compose and I try to connect to the postgres Connection refused Is the server running on host "hola_postgre Connection refused Is the server running on host "hola_postgres_1" (172.18.0.2) and accepting TCP/IP connections on port 5432? I don't understand why it does not work. But, it does not need to be. 2011-09-30 11:42:20. We used the Postgres container name as a hostname, user and password present in the Docker file. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. OperationalError: could not connect to server: Connection refused Is the server running on host "0.


Connection to postgres not working through docker-compose , 1.1 -U postgres psql: could not connect to server: Connection refused Is the server running on host "1.1.1.1" and accepting TCP/IP connections on port 5432? Resetting inventory_sync table psql: could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? Clearing any active FLR counts in summary_counts table psql: could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0


PostgreSQL: Allow Remote Connections · zaiste.net, Pull and run the latest SQL Server Linux container image. named "​my_postgres" connects port 5432 inside Docker as port 54320 on the host is the connection to the database and other services. db - the database server portion of the. When docker-compose up, then PostgreSQL starts but I cannot connect to this. But today i get the error"could not connect to server: Connection refused (0x0000274D/10061)Is the server running on host "???" and accepting TCP/IP connections on port 5432?". How can i check if this has been changed and change the configurations so that it works again.


Docker Compose Connect To Host Database, Before anyone can access the database, you must start the database server. On NetBSD, use either the FreeBSD or Linux start scripts, depending on preference. already in use HINT: Is another postmaster already running on port 5432? psql: could not connect to server: Connection refused Is the server running on  psql: could not connect to server: Connection refused Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? The last line is useful in verifying that the client is trying to connect where it is supposed to.