problem description
node version 8.9.2. The connection mysql8.0, shows that the connection was successful but an error was reported as
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
related codes
const mysql = require("mysql")
const db = mysql.createConnection({
host: "localhost",
user: "root",
password: "123456",
database: "test_self",
})
db.query("SELECT * FROM `users`", (err, data) => {
console.log("") // ""
if (err) {
console.log(err) //
} else {
console.log(data)
}
})