title: Link application with database
body: <p>I'm trying to link up my application with my database using the <a href="https://www.npmjs.com/package/mysql" rel="nofollow noreferrer">mysql</a> library. Here's my code:</p>
  
  <pre><code>//Require Libraries
  const mysql  = require('mysql');
  
  //Set up MySql connection
  const connection = mysql.createConnection({
    host       : "255.255.255.255", //that ain't actually the ip :P
    port       : "3306",
    user       : "root",
    password   : "password :P",
    database   : "db_name"
  });
  
  connection.connect(); //Connect to the database
  </code></pre>
  
  <p>The error the code gives is:</p>
  
  <pre><code>events.js:182
        throw er; // Unhandled 'error' event
        ^
  
  Error: connect ECONNREFUSED (MY IP IS IN THIS BIT):3306
      at Object.exports._errnoException (util.js:1024:11)
      at exports._exceptionWithHostPort (util.js:1047:20)
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1150:14)
      --------------------
      at Protocol._enqueue (C:\file\location:145:48)
      at Protocol.handshake (C:\file\location\Protocol.js:52:23)
      at Connection.connect (C:\file\location\Connection.js:130:18)
      at Object.&lt;anonymous&gt; (C:\file\location\index.js:25:12)
      at Module._compile (module.js:569:30)
      at Object.Module._extensions..js (module.js:580:10)
      at Module.load (module.js:503:32)
      at tryModuleLoad (module.js:466:12)
      at Function.Module._load (module.js:458:3)
      at Function.Module.runMain (module.js:605:10)
  </code></pre>
  
  <p>If you are wondering, the database is most certainly running, I can connect to it using mySQL workbench. Also just a quick note that the database is being hosted remotely just in case that may change anything.</p>