title: node.js + public mysql database : "connect ECONNREFUSED"
body: <p>I'm working behind a proxy and I'm trying to access a following <strong>public</strong> database.</p>
  
  <p>The connection works using a mysql client, from my workplace:</p>
  
  <pre><code>$ mysql -A -u genome -h genome-mysql.cse.ucsc.edu -P 3306 -D hg19 -e 'select now()'
  +---------------------+
  | now()               |
  +---------------------+
  | 2014-03-06 01:56:36 |
  +---------------------+
  </code></pre>
  
  <p>Now, I'm trying to do the same thing using <strong>node</strong>:</p>
  
  <pre><code>var mysql = require('mysql');
  var connection = mysql.createConnection({
    debug:true,
    trace:true,
    host : 'genome-mysql.cse.ucsc.edu',
    port : 3306,
    database: 'hg19',
    user : 'genome',
    password: ''
   });
  connection.connect(function(err) {if(err!=null) console.log(err);});
  connection.end();
  </code></pre>
  
  <p>It works from my home but it raises an error from my workplace </p>
  
  <pre><code>{ [Error: connect ECONNREFUSED]
    code: 'ECONNREFUSED',
    errno: 'ECONNREFUSED',
    syscall: 'connect',
    fatal: true }
  </code></pre>
  
  <p>same error using :  <code>_socket: '/var/run/mysqld/mysqld.sock'</code> as <a href="https://stackoverflow.com/questions/8825342">connect ECONNREFUSED - node js , sql</a></p>
  
  <p>Any suggestion on how to fix this ?</p>