User

A set of methods for managing MySQL users.

JSON Representation

{
  "name": "string",
  "clusterId": "string",
  "permissions": [
    {
      "databaseName": "string",
      "roles": [
        "string"
      ]
    }
  ]
}
Field Description
name string

Name of the MySQL user.

clusterId string

ID of the MySQL cluster the user belongs to.

permissions[] object

Set of permissions granted to the user.

permissions[].
databaseName
string

Name of the database that the permission grants access to.

permissions[].
roles[]
string
  • ALL_PRIVILEGES: All privileges that can be made available to the user.
  • ALTER: Altering tables.
  • ALTER_ROUTINE: Altering stored routines (stored procedures and functions).
  • CREATE: Creating tables or indexes.
  • CREATE_ROUTINE: Creating stored routines.
  • CREATE_TEMPORARY_TABLES: Creating temporary tables.
  • CREATE_VIEW: Creating views.
  • DELETE: Deleting tables.
  • DROP: Removing tables or views.
  • EVENT: Creating, altering, dropping, or displaying events for the Event Scheduler.
  • EXECUTE: Executing stored routines.
  • INDEX: Creating and removing indexes.
  • INSERT: Inserting rows into the database.
  • LOCK_TABLES: Using LOCK TABLES statement for tables available with SELECT privilege.
  • SELECT: Selecting rows from tables.

Some SELECT statements can be allowed without the SELECT privilege. All statements that read column values require the SELECT privilege. See details in MySQL documentation.

  • SHOW_VIEW: Using the SHOW CREATE VIEW statement. Also needed for views used with EXPLAIN.
  • TRIGGER: Creating, removing, executing, or displaying triggers for a table.
  • UPDATE: Updating rows in the database.

Methods

Method Description
create Creates a MySQL user in the specified cluster.
delete Deletes the specified MySQL user.
get Returns the specified MySQL user.
grantPermission Grants a permission to the specified MySQL user.
list Retrieves a list of MySQL users in the specified cluster.
revokePermission Revokes a permission from the specified MySQL user.
update Modifies the specified MySQL user.