Question

ECONNREFUSED 134.122.99.37:5432 [SequelizeConnectionRefusedError]

I am new to the process of setting up a server and connecting my database to it. What I am trying to do: I want to start running my node js application by using npm start.

The Problem: But I get this error:

error from routes.js ConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED 134.122.99.37:5432 . . . original: Error: connect ECONNREFUSED 134.122.99.37:5432 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { errno: ‘ECONNREFUSED’, code: ‘ECONNREFUSED’, syscall: ‘connect’, address: ‘134.122.99.37’, port: 5432 }

To start running on the digital ocean IP address the replaced localhost with the ‘134.122.99.37’.

My config file:

module.exports=new Sequelize(‘db_name’,‘user_name’,‘password’,{ host:‘134.122.99.37’, dialect:‘postgres’, operatorAliases:false, pool:{ max:5, min:0, acquire:30000, idle:10000 }, });

Any good resources/tutorials would be a major help.

Thanks in advance

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi, I have a similar situation, have you fixed the error?

Hi there, I have the same problem “unable to join database connect ECONNREFUSED 127.0.0.1:5432” Did you manage to resolve this issue?

I am using Putty to load my session and connect to it. It has a port number 22. Is that what I should be including in my host maybe?