title: alter user password to connect nodejs with mysql throws error on query
body: <p>I am trying to connect nodejs with mysql using this simple code:</p>
  <pre><code>const express = require('express');
  const app = express();
  const mysql = require(&quot;mysql&quot;);
  require(&quot;dotenv&quot;).config();
  
  app.use(express.json());
  
  const connection = mysql.createConnection({
      host:'localhost',
      user:'root',
      password:'root',
      database:'test'
  });
  
  connection.connect((err)=&gt;{
      if(err) throw err;
      console.log(&quot;Connected to DB);
  });
  
  </code></pre>
  <p>Running code i get my first error:
  <code>Client does not support authentication protocol requested by server;  consider upgrading MySQL client</code>. Googling about this problem i found the same solution so i followed this link <a href="https://stackoverflow.com/questions/50093144/mysql-8-0-client-does-not-support-authentication-protocol-requested-by-server">MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client</a></p>
  <p>Solution says: to execute a query on mysql to alter user <code>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';</code>
  but i get error on <code>BY</code> .
  This is the message: <code>Missing comma before start of a new alter operation. (near &quot;BY&quot; at position 68)</code></p>