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('dbname’,'username’,'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
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.
×