Skip to main content

New user from ADMIN group

  1. Run the following to create a new account.

    {
      "api": "admin",
      "action": "createAccount",
      "params": {
        "username": "ADMIN2",
        "password": "ADMINADMINADMINADMIN"
      },
      "authToken": "replaceWithAuthTokenFromCreateSession"
    }
  2. Run the following to assign the ADMIN role to the newly created account.

    {
      "api": "admin",
      "action": "assignRolesToAccounts",
      "params": {
        "add": [
          {
            "roleNames": [
              "ADMIN"
            ],
            "usernames": [
              "ADMIN2"
            ]
          }
        ]
      },
      "authToken": "replaceWithAuthTokenFromCreateSession"
    }
  3. Run the following in command prompt to grant permissions in SQL.

    GRANT ALL PRIVILEGES ON mqtt_client TO ADMIN2;
    GRANT ALL PRIVILEGES ON mqtt_client_history TO ADMIN2;
    GRANT ALL PRIVILEGES ON mqtt_topic TO ADMIN2;
    GRANT ALL PRIVILEGES ON mqtt_subscription_history TO ADMIN2;
    COMMIT WORK;