O meu estava apresentando este erro abaixo:
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at Handshake.Sequence._packetToError (D:\Alura\Rest com Node - Api com Express e MySQL\node_modules\Mysql\lib\protocol\sequences\Sequence.js:47:14)
at Handshake.ErrorPacket (D:\Alura\Rest com Node - Api com Express e MySQL\node_modules\Mysql\lib\protocol\sequences\Handshake.js:123:18)
at Protocol._parsePacket (D:\Alura\Rest com Node - Api com Express e MySQL\node_modules\Mysql\lib\protocol\Protocol.js:291:23)
at Parser._parsePacket (D:\Alura\Rest com Node - Api com Express e MySQL\node_modules\Mysql\lib\protocol\Parser.js:433:10)
at Parser.write (D:\Alura\Rest com Node - Api com Express e MySQL\node_modules\Mysql\lib\protocol\Parser.js:43:10)
at Protocol.write (D:\Alura\Rest com Node - Api com Express e MySQL\node_modules\Mysql\lib\protocol\Protocol.js:38:16)
at Socket.<anonymous> (D:\Alura\Rest com Node - Api com Express e MySQL\node_modules\Mysql\lib\Connection.js:88:28)
at Socket.<anonymous> (D:\Alura\Rest com Node - Api com Express e MySQL\node_modules\Mysql\lib\Connection.js:526:10)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
--------------------
at Protocol._enqueue (D:\Alura\Rest com Node - Api com Express e MySQL\node_modules\Mysql\lib\protocol\Protocol.js:144:48)
at Protocol.handshake (D:\Alura\Rest com Node - Api com Express e MySQL\node_modules\Mysql\lib\protocol\Protocol.js:51:23)
at Connection.connect (D:\Alura\Rest com Node - Api com Express e MySQL\node_modules\Mysql\lib\Connection.js:116:18)
at Object.<anonymous> (D:\Alura\Rest com Node - Api com Express e MySQL\index.js:4:9)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
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
}
Mas consegui arrumar a conexão criando um novo usuario no workbench mudando o tipo de autenticação em: Users and Privileges, authentication Type: para: "STANDARD". depois de fazer essa mudança para o modo antigo de autenticação deu tudo certo. Mas gostaria de saber qual a forma de conexão, ou melhor, como resolver o problema acima?!!