Get a MySQL instance's credentials

Get the password of the instance's admin user and what you need to connect with TLS. You can get the password again at any time.

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

The ID of the MySQL instance.

Authorization string required

Bearer $TOKEN

200 OK
{
  "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.

user string

The admin user's username, admin.

password string

The admin user's password.

database string

The default database's name.

uri string

The connection URI for clients on your networks, with the password and ssl-mode=REQUIRED.

public_uri string or null

The connection URI for clients on the internet, with the password and ssl-mode=REQUIRED, or null when public_access is off.

ca_certificate string

The CA certificate that signs the instance's TLS certificate, in PEM. Save it to a file to verify the instance's identity.

rotating_until datetime or null

When the previous password stops working, 24 hours after a rotation, or null when no rotation is in progress. In ISO 8601 format, such as 2026-07-01T12:00:00Z.