Failed to Connect to MySQL DB via MySQL JavaScript Module
? ? ? ? I added a "MySQL" database to my "Node.js" server. After going through the "MySQL" setup process — to ensure the DB was working — I attempted to connect to the server via the JavaScript de facto code snippet (example below), and to my dismay, the connection attempt failed.
When the Connection Failed, the Following Error was Logged:
"ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication
protocol requested by server; consider upgrading MariaDB client"
? ? ? ? The error was perplexing to me, as I already uninstalled "MariaDB", and installed "MySQL" in its place. What I would like to know is what is causing the error, and how can I fix it so I am able to connect to the Database?
// This is my attempt of connection
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
password : '********',
database : 'foobarDb'
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…