I'm using bookshelf.js on a node.js project and it works fine on my localhost. But when I tried to put it on AWS + RDS, it gives me the following error:
Express server listening on port 8000
Knex:Error Pool2 - Error: Error allocating resources: connect ECONNREFUSED
Knex:Error Pool2 - Error: Error allocating resources: connect ECONNREFUSED
Obviously my connection configs were changed.
module.exports = {
host : 'https://my_rds_url:3306',
user : 'root',
database : 'my_database',
password : 'my_pw'
}
What could it be?
Thanks.
In most cases this is a problem with giving the other server address than 'localhost'. As I understand you have moved the code from your PC to the remote server. The trick is that node.js is server side so for node this piece of code is still localhost (not remote)
try to change "https://my_rds_url:3306" into "localhost:3306".