Return MySQL user privileges

This function lists a MySQL® database user's privileges.

Important:

When you disable the MySQL role and remote MySQL is not already configured, the system disables this function.

Authorizations:
query Parameters
database
required
string

The database name.

Example: database=mydb
user
required
string

The database user's name.

Important:

If database prefixing is enabled, you must prefix this value with the account prefix and an underscore (_).

For example, for the dbuser user on the user cPanel account, pass in a value of user_dbuser.

Example: user=dbuser

Responses

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object

Request samples

uapi --output=jsonpretty \
  --user=username \
  Mysql \
  get_privileges_on_database \
  user='dbuser' \
  database='mydb'

Response samples

Content type
application/json
{
  • "apiversion": 3,
  • "func": "get_privileges_on_database",
  • "module": "Mysql",
  • "result": {
    • "data": [
      • "CREATE"
      ],
    • "errors": null,
    • "messages": null,
    • "metadata": {
      • "transformed": 1
      },
    • "status": 1,
    • "warnings": null
    }
}