Help in connecting postgres user


I working on an api with adonisjs, i have setup my environment but whenever i try making a call to the api i get this error

password authentication failed for user “root”

How can i fix this error please?

Can you provide more details and post the config/database.js (without your password)? It’s hard for us to help you without more details.

Did you set up your own Postgres? Is this on a cloud hosted Postgres? Can you modify your pg_hba.conf?

The error message tells me that you’re attempting to connect to Postgres as a database user called root. Did you already create this user in the database with your password? Can you connect to it using the default user, postgres?

If you did create a user called root, can you connect as root using psql?

edit config/database.js and change “user: Env.get (‘DB_USER’, ‘root’)” to “user: Env.get (‘DB_USERNAME’, ‘root’)”