title: Cannot connect to MySQL Database on Node.js
body: <p>I still cannot figure out why Im still getting this error message when trying to connect to the MYSQL Server on Node.js - </p>
  
  <p><strong>ERROR -</strong> </p>
  
  <pre><code>Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES)
  at Handshake.Sequence._packetToError (C:\Users\Admin\Desktop\Test Files\Hello World!\node_modules\mysql\lib\protocol\sequences\Sequence.js:52:14)
  at Handshake.ErrorPacket (C:\Users\Admin\Desktop\Test Files\Hello World!\node_modules\mysql\lib\protocol\sequences\Handshake.js:103:18)
  at Protocol._parsePacket (C:\Users\Admin\Desktop\Test Files\Hello World!\node_modules\mysql\lib\protocol\Protocol.js:279:23)
  at Parser.write (C:\Users\Admin\Desktop\Test Files\Hello World!\node_modules\mysql\lib\protocol\Parser.js:76:12)
  at Protocol.write (C:\Users\Admin\Desktop\Test Files\Hello World!\node_modules\mysql\lib\protocol\Protocol.js:39:16)
  at Socket.&lt;anonymous&gt; (C:\Users\Admin\Desktop\Test Files\Hello World!\node_modules\mysql\lib\Connection.js:103:28)
  at emitOne (events.js:115:13)
  at Socket.emit (events.js:210:7)
  at addChunk (_stream_readable.js:266:12)
  at readableAddChunk (_stream_readable.js:253:11)
  </code></pre>
  
  <p><strong>JS -</strong></p>
  
  <pre><code>var mysql = require('mysql');
  var con = mysql.createConnection({
      host: 'localhost', 
      user: 'root', 
      password: '*****', 
      database: 'mydb'
      });
  
  con.connect(function(err) {
      if (err) throw err;
      console.log("Connected!");
  });
  </code></pre>