title: node-mysql error: connect ECONNREFUSED
body: <p>I'm trying to setup a remote connection between my database server and a client node app using node-mysql.</p>
  
  <p>When I try to connect to the remote db, I get this error:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Connecting to a local db works ok (with the socketPort parameter).</p>
  
  <p>I can connect to this remote db with PHP from my computer localhost as well as another server I own so I don't think there's something wrong with mysql conf.</p>
  
  <p>For info, nodejs is running with nginx and I've setup a proxy to make node work on port 80, maybe this is the issue? </p>
  
  <p>How can I check that?</p>
  
  <p>Thanks.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here's my code, just in case:</p>
  
  <pre><code>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'
  });
  </code></pre>