title: "Client does not support authentication protocol requested by server; consider upgrading MySQL client" even after downgrading to mysql@5.7
body: <p>I was originally on mysql 8.0 which gave me the error</p>
  
  <blockquote>
    <p>ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client</p>
  </blockquote>
  
  <p>when trying to run my server. I saw on multiple sources that downgrading to mysql@5.7 would solve the problem because 5.7 uses native password authentication, but the same error is still present after downgrading to the earlier version. Are there any other known reasons as to why the error still persists?</p>
  
  <p>Here is my config file:</p>
  
  <p><code>config.js</code></p>
  
  <pre><code>// import dependencies
  const util = require("util");
  const mysql = require("mysql");
  
  // import environment variables
  const env = {
      env: process.env.NODE_ENV,
      host: process.env.DB_HOST,
      database: process.env.DB_NAME,
      user: process.env.DB_USER,
      password: process.env.DB_PASSWORD
  }
  
  const database = mysql.createConnection({
    host: env.host,
    database: env.database,
    user: env.user,
    password: env.password
  });
  
  database.connect(err =&gt; {
    if (err) {
          console.log("Connection " + err);
    } else {
          console.log(`Connection Success: You are now connected to the ${env.env} database`);
    }
  });
  
  // promisify all database queries
  database.query = util.promisify(database.query);
  
  // export database
  module.exports = database;
  </code></pre>