还是这个问题Client does not support authentication protocol requested by server
来源:6-6 API对接mysql(博客列表)
Narmo
2021-06-18
我按照网上的方法修改了,然后npm run dev
没有问题,但是node ./bin/www.js
就报错了,还是那个not support的错误。
node ./bin/www.js
执行结果:
~/coding/nodejs/node-blog node ./bin/www.js
Listening on 8000
/Users/zhengjihan/coding/nodejs/node-blog/node_modules/mysql/lib/protocol/Parser.js:437
throw err; // Rethrow non-MySQL errors
^
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at Handshake.Sequence._packetToError (/Users/zhengjihan/coding/nodejs/node-blog/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Handshake.ErrorPacket (/Users/zhengjihan/coding/nodejs/node-blog/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
at Protocol._parsePacket (/Users/zhengjihan/coding/nodejs/node-blog/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/Users/zhengjihan/coding/nodejs/node-blog/node_modules/mysql/lib/protocol/Parser.js:433:10)
npm run dev
执行结果:
~/coding/nodejs/node-blog npm run dev
> blog@1.0.0 dev
> cross-env NODE_ENV=dev nodemon --inspect=9229 ./bin/www.js
[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node --inspect=9229 ./bin/www.js`
Debugger listening on ws://127.0.0.1:9229/ab31438d-0e98-4a93-b97b-12ca3eedae9e
For help, see: https://nodejs.org/en/docs/inspector
Listening on 8000
这是为什么呢?
写回答
2回答
-
双越
2021-06-19
哦,抱歉我上次看错了。
`npm run dev`可以了,但是直接用`node ./bin/www.js`不行 —— 你这个问题很怪异,我还没遇到过呢。package.json 中 dev 的具体命令是啥?
062021-06-21 -
双越
2021-06-18
mysql 配置的问题,很常见。可以百度搜一下“mysql Client does not support authentication”
先自己试着解决一下,搞不定的话再来回复我。
012021-06-18
相似问题