title: Unable to connect mysql nodejs
body: <p>I'm trying to connect remote server MySQL database from another test server 
  from my rest API using node js.</p>
  
  <p>My database connection.js</p>
  
  <pre><code>var mysql = require('mysql');
  
  var poolConnection = mysql.createPool({
      connectionLimit : 100,
      host            : 'xx.xx.xx.xxx',
      port            : 3306,
      user            : 'testuser', 
      password        : 'test123',
      socketPath      : '/var/run/mysqld/mysqld.sock'
  });
  
  exports.query = function(sql,args,callback){
      poolConnection.query(sql,args,callback);    
  }
  </code></pre>
  
  <p>While trying to run the query from my API I'm getting this error :</p>
  
  <pre><code>{ Error: connect ENOENT /var/run/mysqld/mysqld.sock
  at Object.exports._errnoException (util.js:1020:11)
  at exports._exceptionWithHostPort (util.js:1043:20)
  at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  ----------------------------
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'connect',
  address: '/var/run/mysqld/mysqld.sock',
  fatal: true }
  </code></pre>
  
  <p>From many another StackOverflow reference, I also try to comment out bind-address but there is also not any success. How to solve this problem.</p>