0

I am trying to connect my node.js script to a MySQL db in PHPmyadmin but I am getting the error "Client does not support authentication protocol requested by server; consider upgrading MySQL client". I am not sure how to fix this issue, this is my code in my script.js:

var express = require('express');
var mysql = require('mysql');
var app = express();

var connection= mysql.createConnection({
    host:'localhost',
    user:'user',
    password:'pass',
    database:'mydb',

});

connection.connect(function(error){
    if(error){
        console.log(error);
    } else{
        console.log('Connected');
    }
});

app.get('/', function(req,resp){
    connection.query("SELECT * FROM Address", function(error,rows,fields){
        if(!!error){
            console.log("error in query");
        } else{
            console.log("successful query");
        }
    });
})

app.listen(1337);
Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
  • phpmyadmin is only one in phpo programmed IDE for mysql. – nbk Mar 22 '20 at 09:23
  • Does this answer your question? [MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client](https://stackoverflow.com/questions/50093144/mysql-8-0-client-does-not-support-authentication-protocol-requested-by-server) – nbk Mar 22 '20 at 09:23

0 Answers0