Description

This function changes a MySQL® database user's password.

Examples 




https://hostname.example.com:2087/cpsess##########/json-api/set_mysql_password?api.version=1&user=username&password=12345luggage&cpuser=example




https://hostname.example.com:2087/cpsess##########/xml-api/set_mysql_password?api.version=1&user=username&password=12345luggage&cpuser=example




whmapi1 set_mysql_password user=username password=12345luggage cpuser=example



{
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": "1",
    "command": "set_mysql_password"
  }
}




<result>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>set_mysql_password</command>
    </metadata>
</result>



Parameters

Parameter
Type
Description
Possible values
Example
userstring

Required

The database username.

A valid database username.

username
passwordstring

Required

The database user's new password.

A secure password.12345luggage
cpuserstring

The cPanel user that controls the database user.

A valid cPanel username.example

Returns

This function only returns metadata.