I'm following a tutorial on the internet to learn MySQL through Node.js, but I'm unable to connect them. Here is the error I'm getting:
code: 'ER_NOT_SUPPORTED_AUTH_MODE',
errno: 1251,
sqlMessage: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client', sqlState: '08004',
fatal: true
My code:
var mysql = require('mysql');
var con = mysql.createConnection({
host: "localhost",
user: "root",
password: "*******"
});
con.connect(function(err) {
if (err) console.log(err);
else
console.log("Connected!");
});
I have installed the MySQL driver using npm and I have just installed MySQL, what am I doing wrong?