title: Can connect to local MySql database on remote server through Workbench but not Node.js
body: <p>I am trying to connect to a mysql database over a remote connection with Node using the packages 'ssh2' and 'mysql2'. My code for connecting looks like below:</p>
  <pre><code>ssh.on('ready', () =&gt; {
    var db_connection = mysql.createConnection({
      host: '127.0.0.1',
      port: 3306,
      user: 'myDBuser',
      password: 'myDBusersPassword'
    });
    
    db_connection.connect();
  
  // The SSH connection is not the issue, so assume correct configuration and working connection
  }).connect(sshConfig);
  </code></pre>
  <p>When I use the exact same credentials in MySql workbench, I am able to connect to the remote sql server just fine. However, when running this code, I am met with the following error:</p>
  <pre><code>Error: connect ECONNREFUSED 127.0.0.1:3306
  
    errno: -61,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 3306,
    fatal: true
  </code></pre>
  <p>Does anyone know why Node would have issues with connecting to the remote SQL server? I assume that it is not even passing my credentials to the server and is outright rejecting the connection from the start.</p>