I am trying to establish a remote connection between my database server and the node client application using node-mysql.
When I try to connect to a remote db, I get this error:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: connect ECONNREFUSED
at errnoException (net.js:646:11)
at Object.afterConnect [as oncomplete] (net.js:637:18)
Connecting to local db is working fine (with socketPort parameter).
I can connect to this remote db with PHP from my localhost computer, as well as with another server that I have, so I don’t think that something is wrong with mysql conf.
For information, nodejs works with nginx, and I installed a proxy server to make node work on port 80, maybe this is a problem?
How can I check this?
Thank.
EDIT
Here is my code, just in case:
var express = require('express');
var mysql = require('mysql');
var app = express();
var connection = mysql.createConnection({
debug: false,
host: '12.34.56.67',
user: 'user',
password: 'pass'
});