简体   繁体   English

NodeJS MySQL 客户端不支持认证协议

[英]NodeJS MySQL Client does not support authentication protocol

When I am trying to connect with mysql 8.0 I am getting this error.当我尝试连接 mysql 8.0 时出现此错误。 How can I fix this?我怎样才能解决这个问题?

code: 'ER_NOT_SUPPORTED_AUTH_MODE',
errno: 1251,
sqlMessage: 'Client does not support authentication protocol requested by server; 
consider upgrading MySQL client',
sqlState: '08004',
fatal: true

Try change the password as below:尝试更改密码如下:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'your new password'; 
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your new password';
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; 
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

FLUSH PRIVILEGES;

"password" is that you have to change the password you already have or you will modify it for a new one “密码”是您必须更改您已有的密码,否则您将修改为新密码

You're probably using mysql npm package which currently doesn't support MySQL 8.0 new default authentication plugin caching_sha2_password.. You can just update your npm package to mysql2 : const mysql = require('mysql2')您可能正在使用mysql const mysql = require('mysql2') package ,目前不支持MySQL 8.0新的默认违约插件插件caching_sha2_pallword ..

More details in this SO answer.SO 答案中的更多详细信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 客户端不支持认证协议 - Client does not support authentication protocol Node JS和mysql连接不上(客户端不支持服务器请求的认证协议考虑升级mysql客户端) - Node JS and mysql not connecting (client does not support authentication protocol requested by server consider upgrading mysql client) 运行问题 MySQL >8.0 sqlMessage:“ '客户端不支持服务器请求的认证协议; 考虑升级 MySQL 客户端',” - Problem running MySQL >8.0 sqlMessage:“ 'Client does not support authentication protocol requested by server; consider upgrading MySQL client',” MySQL 8.0 - 客户端不支持服务器请求的认证协议; 考虑升级 MySQL 客户端 - MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client 客户端不支持服务器请求的身份验证协议 - Client does not support authentication protocol requested by server ER_NOT_SUPPORTED_AUTH_MODE:客户端不支持服务器请求的认证协议; 考虑升级 MySQL 客户端 - ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client 客户端不支持服务器请求的身份验证协议; 考虑升级MySQL客户端 - Client does not support authentication protocol requested by server; consider upgrading MySQL client 错误:客户端不支持服务器请求的认证协议; 考虑升级 MySQL 客户端 - Error: Client does not support authentication protocol requested by server; consider upgrading MySQL client 客户端不支持服务器请求的身份验证协议,请考虑升级mysql客户端 - client does not support authentication protocol requested by server consider upgrading mysql client errno: 1251, sqlMessage: '客户端不支持服务器请求的认证协议; 考虑升级MySQL客户端 - errno: 1251, sqlMessage: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM