尝试将mysql连接到node.js时出现错误消息

时间:2019-03-02 21:35:36

标签: javascript mysql node.js mysql-workbench node-modules

抛出错误; //抛出非MySQL错误 错误:ER_NOT_SUPPORTED_AUTH_MODE:客户端不支持服务器请求的身份验证协议。考虑升级MySQL客户端

//app.js

const mysql = require('mysql');
const connection = mysql.createConnection({
  host: 'localhost',
  user: 'root',
  password: '',
  database: ''
});
connection.connect((err) => {
  if (err) throw err;
  console.log('Connected!');
});

0 个答案:

没有答案