This section describes the operations that are supported for managing database users.
In this section, "user has access to a database" means that the user has full create, read, update, and delete access to the given database. In other words, on a cloud database instance, a user named USER and a database named DATABASE exist, and within MySQL, a GRANT ALL ON DATABASE.* TO USER has been issued on the instance.
![]() | Warning |
---|---|
There is a bug in a python library that development is using that may cause incorrect user deletions to occur if a period (.) is used in the user name. In this case, the user name is truncated to remove the portion of the name from the period to the end, leaving only the portion from the beginning up to the period. For example, for a user named "my.userA", the bug would truncate the user name to "my", and if the user "my" exists, that user will be incorrectly deleted. To avoid the problem, do not use periods in user names. |
Verb | URI | Description |
---|---|---|
POST | /instances/{instanceId}/users | Creates a user for the specified database instance. |
GET | /instances/{instanceId}/users | Lists the users in the specified database instance. |
PUT | /instances/{instanceId}/users | Changes the MySQL password of one or more users. |
GET | /instances/{instanceId}/users/{name} | Lists the specified user's name and a list of databases that the user can access. |
DELETE | /instances/{instanceId}/users/{name} | Deletes the user identified by {name} for the specified database instance. |
GET | /instances/{instanceId}/users/{name}/databases | Shows a list of all databases a user has access to. |
PUT | /instances/{instanceId}/users/{name}/databases | Grant access for the specified user to one or more databases for the specified instance. |
DELETE | /instances/{instanceId}/users/{name}/databases/{databaseName} | Remove access to the specified database for the specified user. |