javascript - 我正在尝试在 sequelize 的帮助下将 mysql 数据库与 node.js 连接,但我显示访问被拒绝

标签 javascript mysql node.js sequelize.js

我正在尝试使用 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) (Use node --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/

相关文章:

javascript - 如果文本链接到特定页面,则在文本旁边添加图像

javascript - 在网站上使用 JavaScript 提供图像

具有连接操作的 MySQL group_concat() 函数

node.js - Node 调用带有临时表的 postgres 函数导致 "memory leak"

javascript - 如何在node js中设置超时回调函数

javascript - Nodejs : Issue with async and forEach - Need to wait the async to resolve

javascript - firebug 错误地告诉我我的变量没有定义

javascript - 使用 HeadJS 加载的脚本仅在第二次单击时运行

mysql - 将 MySQL 数据库从本地服务器迁移到 Heroku

javascript - 禁用相似下拉列表之间的选定选项