Erro during migration run - postgresql

Error during migration run:
Error: connect ECONNREFUSED 127.0.0.1:5432.
I have no experience with postgres and database, but after running "yarn typeorm migration:run"
I get this error.

Related

Error: FATAL Role Does Not Exist When Connecting to Heroku PostgreSQL Database

When attempting to connect to a Heroku PostgreSQL database using the command :
heroku pg:psql postgresql-[database plan]-[unique identifier] --app [app name] ,
or
psql "postgres://[user]:[password]#[host]:[port]/[dbname],
an error message is returned saying that the role "user" does not exist and the psql command exits with code 2.
I have already checked the database credentials, and they are correct. The user exist.
gitpod /workspace/deploying-fullstack-with-heroku-sample (main)
$ heroku pg:psql postgresql-*****-***** --app deploying-fullstack-with-heroku-sample
--> Connecting to postgresql--*****-*****
psql: error: FATAL: role "*****" does not exist
▸ psql exited with code 2

Can't migrate schema using Prisma with Supabase

When I use the Postgres database on Supabase I run the following command, npx prisma migrate dev --name init, but I get the following error (first command in screenshot):
Error: db error: FATAL: bouncer config error
0: migration_core::state::DevDiagnostic
at migration-engine/core/src/state.rs:251
When I use railway.app, with a Postgres database it migrates successfully (second command in screenshot).
I fixed this error on my end by replacing the port number of my connection string from 6543 to 5432.
Reason: 6543 is the pooled port number which should not be used when migrating, instead the non-pooled connection string using 5432 should be used
Hope this helps!
Source:
Second paragraph of the section "Connection pooling with Supabase" https://supabase.com/docs/guides/integrations/prisma#connection-pooling-with-supabase

Restore MongoDB locally using MongoRestore

I just installed MongoDB version 4.2.23. I have a TAR.GZ backup that I have extracted. The extracted file has several BSON & JSON files. I am now trying to restore to a database using MongoRestore and the BSON files and am running into an error.
The command I tried is mongorestore -u $admin-p #password -d MongoDB --host=localhost:27017 acknowledgments.bson
After executing that I am getting the following message error connecting to host: could not connect to server: connection() : auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed.
Any advice would be appreciated in doing a restore.
Update
I have created a user in the database I am attempting to restore. I created a user with the following command: db.create({user: "new_user", pwd: passwordPrompt(), roles: ["readWrite", "dbAdmin"]})
With the new user, I am trying to do the restore as the new user created using the following command: mongorestore -u $new_user_created -d MongoDB --host=localhost:27017 acknowledgments.bson
However I am still receiving the same error.
error connecting to host: could not connect to server: connection() : auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed.

pgbouncer throws Pooler Error: Auth Failed when using datagrip but NOT when using pgadmin

I have a postgres database (version 9.2) running on Centos 6.9.
I am running pgbouncer version 1.6.1
When I try connect to postgres using datagrip from my Mac, I get:
08P01: Error: Auth Failed
And I get on the server:
/var/log/pgbouncer.log
2021-05-21 18:29:02.644 7489 WARNING C-0x15cf078: postgres/jode#127.0.0.1:56254 Pooler Error: Auth failed
When I login to postgres using Pgadmin 4 from the same Mac and same settings, I get right in and there are no errors or warnings in pgbouncer.
What could the problem?
PgAdmin is not working via JDBC. So you need to configure pgBouncer to accept TCP/IP connections (see similar dba exchange question)

Unable to create a user in mac Os 11.3.1 when installing new postgres for first time

I'm using Mac os 11.3.1 but unable to get in psql console at all everything to get in the psql console doesn't seem working everytime it throw an error psql: error: FATAL: role "ksh" does not exist
createuser: error: could not connect to database template1: FATAL: role "ksh" does not exist
It seems like that brew does not create a default user for the postgres while installing it
Can anyone help me with this issue or anyone facing the same?