title: How can I get more information on why my MySQL connection gets ECONNREFUSED?
body: <p>I'm trying to use <code>promise-mysql</code> (node module) to connect to a MySQL instance, but it fails with <code>ECONNREFUSED</code>. Here's the entire error:</p>
  
  <pre><code>{ Error: connect ECONNREFUSED 172.18.0.6:3306
      at Object.exports._errnoException (util.js:1018:11)
      at exports._exceptionWithHostPort (util.js:1041:20)
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
      --------------------
      at Protocol._enqueue (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:141:48)
      at Protocol.handshake (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:52:41)
      at Connection.connect (/usr/src/app/node_modules/mysql/lib/Connection.js:130:18)
      at connect (/usr/src/app/node_modules/promise-mysql/lib/connection.js:18:33)
      at /usr/src/app/node_modules/promise-mysql/lib/connection.js:52:9
      at Promise._execute (/usr/src/app/node_modules/bluebird/js/release/debuggability.js:300:9)
      at Promise._resolveFromExecutor (/usr/src/app/node_modules/bluebird/js/release/promise.js:483:18)
      at new Promise (/usr/src/app/node_modules/bluebird/js/release/promise.js:79:10)
      at new connection (/usr/src/app/node_modules/promise-mysql/lib/connection.js:51:12)
      at Object.exports.createConnection (/usr/src/app/node_modules/promise-mysql/index.js:6:12)
      at Context.&lt;anonymous&gt; (/usr/src/app/test/default-parameters.test.js:9:10)
      at callFn (/usr/src/app/node_modules/mocha/lib/runnable.js:345:21)
      at Hook.Runnable.run (/usr/src/app/node_modules/mocha/lib/runnable.js:337:7)
      at next (/usr/src/app/node_modules/mocha/lib/runner.js:309:10)
      at Immediate.&lt;anonymous&gt; (/usr/src/app/node_modules/mocha/lib/runner.js:339:5)
      at runCallback (timers.js:666:20)
      at tryOnImmediate (timers.js:639:5)
      at processImmediate [as _immediateCallback] (timers.js:611:5)
    code: 'ECONNREFUSED',
    errno: 'ECONNREFUSED',
    syscall: 'connect',
    address: '172.18.0.6',
    port: 3306,
    fatal: true }
  </code></pre>
  
  <p>I have no idea why this is happening. How can I get more information on why the connection is refused? </p>
  
  <p>With "more information" I mean stuff like:</p>
  
  <ul>
  <li>Is this because of invalid credentials?</li>
  <li>Is the host unreachable?</li>
  <li>Is the host reachable but the MySQL server down?</li>
  <li>Are we hitting a MySQL connection limit?</li>
  <li>Are there gnomes in my computer trying to make me mad?</li>
  </ul>