derta
derta

Reputation: 1

How can i solve this error when i use mysql module?

I use the node module to connect my local database, then log this error message:

Client does not support authentication protocol requested by server; consider upgrading MySQL client next is my configuration:

const mysql = require("mysql");
const db = mysql.createPool({
  host: "127.0.0.1",
  user: "root",
  password: "root",
  database: "my_db_01"
});

db.query('select 1', (err, results)=>{
    if (err) return console.log(err.message);
    console.log(results);
});

I can make sure the configuration is correct.

Upvotes: 0

Views: 40

Answers (1)

Quentin
Quentin

Reputation: 943630

This looks like a frequent issue in the bug reports for the mysql module.

That module hasn't had a commit since 2020. It has 172 open issues. I would consider it abandoned.

Use a different database module. mysql2 seems to be popular.

Upvotes: 1

Related Questions