gpt4 book ai didi

mysql - ER_NOT_SUPPORTED_AUTH_MODE : Client does not support authentication protocol requested by server; consider upgrading MySQL client

转载 作者:行者123 更新时间:2023-11-29 04:15:11 29 4
gpt4 key购买 nike

在nodejs中使用mysql的问题

const mysql      = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
password : '123456789',
database : 'userdata'
});

connection.connect(function(err) {
if (err) {
console.error('error connecting: ' + err);
return;
}

console.log('connected as id ' + connection.threadId);
});

错误:ER_NOT_SUPPORTED_AUTH_MODE:客户端不支持服务器请求的身份验证协议(protocol);考虑升级 MySQL 客户端

最佳答案

遇到了同样的问题。

安装 MySQL Workbench

执行此查询:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456789'; 在 MySQL Workbench 中

返回 Node.js 并尝试再次运行该文件。它应该有用,至少对我有用。

关于mysql - ER_NOT_SUPPORTED_AUTH_MODE : Client does not support authentication protocol requested by server; consider upgrading MySQL client,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52815608/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com