node-pg-migrate icon indicating copy to clipboard operation
node-pg-migrate copied to clipboard

could not connect to postgres: error: no PostgreSQL user name specified in startup packet

Open GHCMelo opened this issue 2 years ago • 0 comments

I'm getting the following error:

could not connect to postgres: error: no PostgreSQL user name specified in startup packet

When I use the following command:

node-pg-migrate up --envPath ./.env.local -m infra/migrations/

My .env.local file:

POSTGRES_USER=local_user POSTGRES_PASSWORD=local_password POSTGRES_DB=controle_de_gastos POSTGRES_HOST=localhost POSTGRES_PORT=54320 DATABASE_URL=postgres://local_user:local_password@localhost:54320/controle_de_gastos

I tried to connect to my database using DATABASE_URL string and I got success.

GHCMelo avatar Jan 10 '23 22:01 GHCMelo