我正在尝试将loopback连接到我已设置的现有mysql数据库,即使我的数据库信息在datasources.json中正确配置,我也收到以下错误。
“错误”:{ “statusCode”:401, “名字”:“错误”, “消息”:“需要授权”, “code”:“AUTHORIZATION_REQUIRED”, “stack”:“错误:需要授权\ n /home/gil/loopback/loopback-getting-started/node_modules/loopback/lib/application.js:399:21 \ n at home / gil / loopback / loopback- get-started / node_modules / loopback / lib / model.js:349:7 \ n athome/gil/loopback/loopback-getting-started/node_modules/loopback/common/models/acl.js:472:23\n at /home/gil/loopback/loopback-getting-started/node_modules/async/dist/async.js:3824:9,n at / home / gil / loopback / loopback-getting-started / node_modules / async / dist / async .js:460:16 \ n ateratorCallback(/home/gil/loopback/loopback-getting-started/node_modules/async/dist/async.js:1034:13)\n at / home / gil / loopback / loopback- get-started / node_modules / async / dist / async.js:944:16 \ n在/home/gil/loopback/loopback-getting-started/node_modules/async/dist/async.js:3821:13在申请时(/home/gil/loopback/loopback-getting-started/node_modules/async/dist/async.js:21:25)\n at / home / gil / loopback / loopback-getting-started / node_modules / async / dist / async.js: 56:12 \ n athome/gil/loopback/loopback-getting-started/node_modules/loopback/common/models/acl.js:454:17 \ n at home / gil / loopback / loopback-getting-started / node_modules / loopback / common / models / role.js:273:21 \ n在_combinedTickCallback(internal / process / next_tick.js:73:7)\ n at process._tickDomainCallback(internal / process / next_tick.js:128:9 )” }
有人能指出我正确的方向吗?
答案 0 :(得分:1)
这与MySQL无关,似乎您的终端上的ACL有问题。确保您的端点具有正确的ACL,您尝试访问的模型应该具有带ACL条目的json文件。如果你希望它允许每个人清除它。