I am attempting to connect to mySQL through a NodeJS file, but I receive the following error:
{ Error: ER_ACCESS_DENIED_ERROR: Access denied for user \'root\
//surprisingly this works.
var mysql = require('mysql'); var con = mysql.createConnection({ host: "localhost", user: "root", password: "" }); con.connect(function(err) { if (err) throw err; console.log("Connected!"); });