关于nodejs报错Client does not support authentication protocol requested by server; consider upgrading My
Client does not support authentication protocol requested by server; consider upgrading MySQL client
at Handshake.Sequence._packetToError
这个错误原因是,目前,最新的mysql模块并未完全支持MySQL 8的“caching_sha2_password”加密方式,而“caching_sha2_password”在MySQL 8中是默认的加密方式。因此,下面的方式命令是默认已经使用了“caching_sha2_password”加密方式,该账号、密码无法在mysql模块中使用。
解决方法是:登录
mysql -u root -p
输入下面命令
后面是密码 我的密码123456你们自己改自己的就行了
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
第二个问题是
getaddrinfo ENOTFOUND 127.0.0.1 localhost localhost:3306
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete]
这个的话是没有指定 localhost,在host文件中添加如下内容:
127.0.0.1 localhost
mac和linux :sudo vim /etc/hosts
window在C:\Windows\System32\drivers\etc\hosts 这个hosts文件编辑
添加这个就行了
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
上一篇: 设计模式学习笔记——原型模式
下一篇: Python3之基本数据类型
推荐阅读
-
mysql Client does not support authentication protocol requested by server; consider upgrading MySQL
-
解决Navicat连接MySQL时“Client does not support authentication protocol requested by server; consider upgrading MySQL client”的问题
-
连接8.0.15mysql 报错 client does not support authentication protocol requested by server ,consider upgra
-
nodejs连接mysql报错:Client does not support authentication protocol requested by server; consider upgrad
-
MySQL8.0报错Client does not support authentication protocol requested by server; consider upgrading My
-
MySql 链接报错“Client does not support authentication protocol requested by server; consider upgradin”
-
node连接数据库报错Client does not support authentication protocol requested by server; consider upgrading M
-
关于nodejs报错Client does not support authentication protocol requested by server; consider upgrading My
-
MySql8.0,使用Navicat连接时报错:Client does not support authentication protocol requested by server;consider
-
navicate连接MySQL出现报错client does not support authentication protocol requested by server consider ...