错误信息
2019-01-03 21:05:03,788 ERROR 5128 nodejs.ER_NOT_SUPPORTED_AUTH_MODEError: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at Handshake.Sequence._packetToError (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\protocol\sequences\Sequence.js:47:14)
at Handshake.ErrorPacket (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\protocol\sequences\Handshake.js:124:18)
at Protocol._parsePacket (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\protocol\Protocol.js:278:23)
at Parser.write (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\protocol\Parser.js:76:12)
at Protocol.write (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\protocol\Protocol.js:38:16)
at Socket.<anonymous> (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\Connection.js:91:28)
at Socket.<anonymous> (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\Connection.js:502:10)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
--------------------
at Protocol._enqueue (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\protocol\Protocol.js:144:48)
at Protocol.handshake (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\protocol\Protocol.js:51:23)
at PoolConnection.connect (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\Connection.js:118:18)
at Pool.getConnection (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\Pool.js:48:16)
at C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_pify@2.3.0@pify\index.js:29:7
at new Promise (<anonymous>)
at Pool.<anonymous> (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_pify@2.3.0@pify\index.js:12:10)
at Pool.ret [as getConnection] (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_pify@2.3.0@pify\index.js:56:34)
at Pool.query (C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_mysql@2.16.0@mysql\lib\Pool.js:202:8)
at C:\Users\shanbaobao\Documents\Source Code\webworkbench\webworkbench-node\node_modules\_pify@2.3.0@pify\index.js:29:7
sql: select now() as currentTime;
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
name: "ER_NOT_SUPPORTED_AUTH_MODEError"
pid: 5128
hostname: shanbaobao-PC
2019-01-03 21:05:03,821 ERROR 5128 [app_worker] start error, exiting with code:1
解决方案,执行如下脚本
USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
FLUSH PRIVILEGES;
网友评论