Client does not support authentication protocol requested by server; consider upgrading MySQL client

node js 连接数据库报错

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

 

我的 mysql 还是 docker

进入 容器中 

docker exec -it c5dd28105fe5 /bin/bash

输入密码

 mysql -u root -p

ALTER USER 'root' IDENTIFIED WITH mysql_native_password BY '123456';

刷新

flush privileges;

 测试成功连接了

 

节点.js - MySQL 8.0 - 客户端不支持服务器请求的身份验证协议;考虑升级 MySQL 客户端 - 堆栈溢出 (stackoverflow.com)

 

posted on 2023-04-25 22:43  是水饺不是水饺  阅读(59)  评论(0)    收藏  举报

导航