[英]ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
Problem in mysql used in nodejs 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);
});
Error : ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server;错误: ER_NOT_SUPPORTED_AUTH_MODE:客户端不支持服务器请求的认证协议; consider upgrading MySQL client
考虑升级 MySQL 客户端
Had the same problem.有同样的问题。
Install MySQL Workbench安装MySQL 工作台
Execute this query: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456789';
执行此查询:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456789';
in MySQL Workbench在 MySQL 工作台中
Head back over to Node.js and try running the file again.返回到 Node.js 并尝试再次运行该文件。 It should work, at least it did for me.
它应该有用,至少对我有用。
You installed mysql server using "mysql installer"您使用“mysql安装程序”安装了mysql服务器
1)open -> "mysql intsaller"
2)press reconfig mysql server
3)select left side "authentication method tab"
4)select radio button -->use legacy authentication method
5)now stop and restart the db
Thanks!谢谢!
in any database software mysql workbench,datagrip, dbeaver...在任何数据库软件 mysql workbench、datagrip、dbeaver 中...
1st run this query:第一次运行此查询:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
=---->if still your problem persist =---->如果您的问题仍然存在
2nd run this query:第二次运行这个查询:
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
combine and run this 2 queries seperated worked for me with dockorize mysql结合并运行这 2 个单独的查询,使用 Dockorize mysql 为我工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.