【问题标题】:Worklight, SQL-Adapter, The user specified as a definer ('mobilefirst'@'localhost') does not existWorklight、SQL-Adapter、指定为定义者的用户 ('mobilefirst'@'localhost') 不存在
【发布时间】:2015-04-12 17:40:18
【问题描述】:

我是 sql 和 worklight 的新手。我关注来自 IBM Worklight 的 SQL-Adapter tutorial,并将示例代码导入 Worklight Studio。

部署适配器后,我选择 Run as -> Call Mobilefirst Adapter。

这是我对“getAccountTransactions1”程序的回复:

{   "isSuccessful": true,   "resultSet": [   ]}

这是我对“getAccountTransactions2”过程的回应:

{   "errors": [      "Runtime: Failed to retrieve data with procedure : getAccountTransactions"   ],   "info": [   ],   "isSuccessful": false,   "warnings": [   ]}

这是过程“getAccountTransactions2”的错误控制台

FWLSE0101E: 原因:[project Adapters]java.sql.SQLException: 指定为定义者 ('mobilefirst'@'localhost') 的用户不存在java.lang.RuntimeException: 检索失败带有过程的数据:getAccountTransactions

我认为我的 sql 用户 'mobilefirst'@'localhost' 有问题,但我不知道为什么,因为我在 SQLAdapter.xml 中使用 root 用户。

如果我将它用作此示例代码的默认值,如何设置“Worklight”sql 用户的权限?

Image for error console

【问题讨论】:

  • 检查我的答案,如果对你有帮助,别忘了选择它作为正确答案。

标签: sql ibm-mobilefirst worklight-adapters


【解决方案1】:

您提到了用户“mobilefirst”,这使您看起来像是在使用 MobileFirst Platform Foundation 6.3 或 7.0(以前称为“Worklight”),但由于某种原因,您正在关注/使用来自 Worklight 的示例6.0.0.0……这是为什么呢?

您在数据库中以某种方式混合了一些东西......

无论您造成混乱的原因是什么,最简单的解决方案是简单地将所有权限授予 mobilefirst@localhost 用户和 Worklight@localhost。

然后,您还需要确保在适配器的 XML 文件中使用的是同一用户 - “mobilefirst”或“Worklight”(数据库中您已授予所有权限的同一用户)。

要运行确切的查询,您可以参考 Stanislovas 的回答 - 只需将“root”替换为适当的用户名即可。

并且不要将旧样品与新产品版本混为一谈...

【讨论】:

  • 是的,我对这些版本感到困惑。在使用 6.0.0.0 获得 Worklight@localhost 的所有权限后,它可以工作
  • 你能告诉我为什么“resultSet”是空的吗?
  • 如果我没记错的话,您应该在窗口中提供帐号。 “12345”。
【解决方案2】:

创建该程序的用户已被删除。如果 您重新创建该用户,它应该可以解决您的错误。

你可以尝试使用:

grant all on *.* to 'root'@'%' identified by 'password' with grant option;

【讨论】:

    猜你喜欢
    • 2017-02-16
    • 2022-01-14
    • 2016-11-16
    • 2020-09-19
    • 2016-07-13
    • 2013-12-09
    • 2020-09-25
    • 2021-07-28
    • 2012-04-27
    相关资源
    最近更新 更多