Skip to main content

List MySQL users belonging to a Database

GET/v2/mysql-databases/{mysqlDatabaseId}/users
API version
v2
Request method
GET
Operation ID
database-list-mysql-users

Request​

  • mysqlDatabaseIdstringrequired

    ID of the MySQLDatabase to list Users for.

Responses​

Format
application/json
Description

OK

  • Array[
    • *object
      • accessLevelstring (one of: full, readonly)required

        The access level that this MySQLUser should have for the database. The full access level grants the user read/write privileges on the database.

      • createdAtstring (date-time)required
      • databaseIdstring (uuid)required
      • descriptionstring
      • disabledbooleanrequired
      • externalAccessbooleanrequired

        Describes if users should be able to connection to this database from external sources. Defaults to false when not set.

        To find out how to connect to your database from external sources, refer to the externalHostname field of the GET /v2/mysql-databases/{id} endpoint.

      • idstring (uuid)required
      • mainUserbooleanrequired

        Indicates whether this MySQL user is the main user of the database. The main user is created by default when a new MySQL database is provisioned. It can neither be deleted nor disabled, but its password can be updated.

      • namestringrequired

        The name of the MySQL user. This can be used as the username when connecting to the database.

      • passwordUpdatedAtstring (date-time)required
      • statusstring (one of: pending, ready, error, terminating, disabled)required
      • statusSetAtstring (date-time)required
      • updatedAtstring (date-time)required
    ]
Content-Type: application/json

[
{
"accessLevel": "full",
"createdAt": "1985-10-26T01:21:00.000Z",
"databaseId": "f0f86186-0a5a-45b2-aa33-502777496347",
"description": "string",
"disabled": true,
"externalAccess": true,
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"mainUser": true,
"name": "dbu_XXXXXX",
"passwordUpdatedAt": "1985-10-26T01:21:00.000Z",
"status": "pending",
"statusSetAt": "1985-10-26T01:21:00.000Z",
"updatedAt": "1985-10-26T01:21:00.000Z"
}
]
{
"items": {
"properties": {
"accessLevel": {
"description": "The access level that this MySQLUser should have for the database. The `full` access level grants\nthe user read/write privileges on the database.\n",
"enum": [
"full",
"readonly"
],
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"databaseId": {
"format": "uuid",
"type": "string"
},
"description": {
"type": "string"
},
"disabled": {
"type": "boolean"
},
"externalAccess": {
"description": "Describes if users should be able to connection to this database from external sources.\nDefaults to `false` when not set.\n\nTo find out how to connect to your database from external sources, refer to the `externalHostname`\nfield of the `GET /v2/mysql-databases/{id}` endpoint.\n",
"type": "boolean"
},
"id": {
"format": "uuid",
"type": "string"
},
"mainUser": {
"description": "Indicates whether this MySQL user is the main user of the database. The main user is created by\ndefault when a new MySQL database is provisioned. It can neither be deleted nor disabled,\nbut its password can be updated.\n",
"type": "boolean"
},
"name": {
"description": "The name of the MySQL user. This can be used as the username when connecting to the database.\n",
"example": "dbu_XXXXXX",
"type": "string"
},
"passwordUpdatedAt": {
"format": "date-time",
"type": "string"
},
"status": {
"enum": [
"pending",
"ready",
"error",
"terminating",
"disabled"
],
"type": "string"
},
"statusSetAt": {
"format": "date-time",
"type": "string"
},
"updatedAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"createdAt",
"updatedAt",
"databaseId",
"name",
"passwordUpdatedAt",
"mainUser",
"disabled",
"accessLevel",
"externalAccess",
"status",
"statusSetAt"
],
"type": "object"
},
"type": "array"
}

Usage examples​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/mysql-databases/string/users
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.database.listMysqlUsers({
"mysqlDatabaseId": "string"
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Database\ListMysqlUsers\ListMysqlUsersRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new ListMysqlUsersRequest(
mysqlDatabaseId: "string"
));
$response = $client->database()->listMysqlUsers($request);

var_dump($response->getBody();

On this page