Rotate a MySQL instance's credentials

Set a new password for the instance's admin user. The previous password keeps working for 24 hours. The instance must be running or degraded.

POST https://{availability_zone}.betterstackcloud.com/v1/mysql/{id}/credentials/rotate
id string required

The ID of the MySQL instance to rotate.

Authorization string required

Bearer $TOKEN

202 Accepted
{
  "user": "jane@example.com",
  "password": "example",
  "database": "example",
  "uri": "example",
  "public_uri": "example",
  "ca_certificate": "example",
  "rotating_until": "2026-07-01T12:00:00.000Z"
}

Returns the connection details as one object, with the new password.

user string

The admin user's username, admin.

password string

The admin user's new password.

database string

The default database's name.

uri string

The connection URI for clients on your networks, with the new password.

public_uri string or null

The connection URI for clients on the internet, with the new password, or null when public_access is off.

ca_certificate string

The CA certificate that signs the instance's TLS certificate, in PEM.

rotating_until datetime or null

When the previous password stops working, 24 hours from now. In ISO 8601 format, such as 2026-07-01T12:00:00Z.