سلام
من دقیقا مثل شما پیش میرم ولی کلا mysql2 برام این ارور رو میده با اینکه هم یوزر رو ست کردم و هم پسورد رو ولی ظاهرا میگه یوزر خالی دسترسی نداره. و مقدار use_password هم no هست در صورتی که من چیزی رو ست نکردم. و توی مثالهای داخل ریپوزیتوری mysql2 هیچ نمونه ای وجود نداشت که پسورد ست کنه.
(node:50563) UnhandledPromiseRejectionWarning: Error: Access denied for user ''@'localhost' (using password: NO)
at PromiseConnection.query (/Users/jalallinux/Downloads/Learning/Temp/node_modules/mysql2/promise.js:92:22)
at exports.getUsers (/Users/jalallinux/Downloads/Learning/Temp/userService.js:4:28)
at Object.<anonymous> (/Users/jalallinux/Downloads/Learning/Temp/index.js:5:1)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
(node:50563) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:50563) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[nodemon] clean exit - waiting for changes before restart