Requires authorization
Sets the password for the root user of the specified Cloud SQL instance. Try it now .
Sets the password of the 'root'@'%' MySQL account.
Request
HTTP request
POST https://www.googleapis.com/sql/v1beta3/projects/project/instances/instance/setRootPassword
Parameters
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
instance
|
string
|
Cloud SQL instance ID. This does not include the project ID. |
project
|
string
|
Project ID of the project that contains the instance. |
Authorization
This request requires authorization with the following scope ( read more about authentication and authorization ).
Scope |
---|
https://www.googleapis.com/auth/sqlservice.admin
|
Request body
In the request body, supply data with the following structure:
{ "setRootPasswordContext": { "kind": "sql#setRootUserContext", "password": string } }
Property name | Value | Description | Notes |
---|---|---|---|
setRootPasswordContext
|
nested object
|
Set Root Password Context. | |
setRootPasswordContext.
kind
|
string
|
This is always
sql#setRootUserContext
.
|
|
setRootPasswordContext.
password
|
string
|
The password for the root user. |
Response
If successful, this method returns a response body with the following structure:
{ "kind": "sql#instancesSetRootPassword", "operation": string }
Property name | Value | Description | Notes |
---|---|---|---|
kind
|
string
|
This is always
sql#instancesSetRootPassword
.
|
|
operation
|
string
|
An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
Try it!
Use the APIs Explorer below to call this method on live data and see the response.