我正在尝试使用 sequelize 连接 mysql 数据库是否都需要诸如授予权限之类的东西。
但我也收到了错误
"node:21352) UnhandledPromiseRejectionWarning: SequelizeAccessDeniedError: Access denied for user ''@'localhost' (using password: YES)
at ConnectionManager.connect (e:\HTML CSS JSS\Node\node_modules\sequelize\lib\dialects\mysql\connection-manager.js:118:17) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async ConnectionManager._connect (e:\HTML CSS JSS\Node\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:318:24) at async e:\HTML CSS JSS\Node\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:250:32 at async ConnectionManager.getConnection (e:\HTML CSS JSS\Node\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:280:7) at async e:\HTML CSS JSS\Node\node_modules\sequelize\lib\sequelize.js:613:26 at async Sequelize.authenticate (e:\HTML CSS JSS\Node\node_modules\sequelize\lib\sequelize.js:867:5) (Usenode --trace-warnings ...
to show where the warning was created) (node:21352) 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:21352) [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. "
最佳答案
检查您的配置,因为似乎未检测到用户,可能还有密码
关于javascript - 我正在尝试在 sequelize 的帮助下将 mysql 数据库与 node.js 连接,但我显示访问被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67699562/