Without using my .env file it work but when I used to create a connection it fails.
var mysql = require('mysql');
require('dotenv').config();
const db = mysql.createConnection({
host: process.env.HOST,
port: "3306",
user: process.env.USER,
password: process.env.PASSWORD,
database: process.env.DATABASE
});
module.exports = db
I have this error.
error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
But I'm already up-to-date with the last mysql version.
Any idea ?
I tried already this, but it didn't work too even if I can run those commands.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
flush privileges;