To reset the password for a database user, send a POST request to
/v2/databases/$DATABASE_ID/users/$USERNAME/reset_auth
.
For mysql
databases, the authentication method can be specifying by
including a key in the JSON body called mysql_settings
with the auth_plugin
value specified.
The response will be a JSON object with a user
key. This will be set to an
object containing the standard database user attributes.
Name | Type | Required | Description | Default Value |
---|---|---|---|---|
database_cluster_uuid |
string | True | A unique identifier for a database cluster. | |
username |
string | True | The name of the database user. | |
body |
JSON or IO[bytes] | True |
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"mysql_settings": {
"auth_plugin": "caching_sha2_password"
}
}
get_resp = client.databases.reset_auth(database_cluster_uuid="a7a8bas", username="admin", body=req)
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.