ResetAccountPassword
Resets the password of a database account in an ApsaraDB for MongoDB instance.
Operation description
Asynchronous operation: Returns a
RequestIdto indicate that the request is accepted.The backend verifies whether the account exists. For accounts in the database, the system queries the accounts table. For accounts outside the database, the system queries the instance directly by using a fail-closed mechanism. If the account does not exist or the
DBNamedoes not match the actual database where the account resides,InvalidAccountName.NotFoundis returned.System account handling: The password of the
rootaccount can be reset. This is a standard feature, and accounts in the database follow the original path. In scenarios outside the database, requests to reset the password of therootaccount or accounts with the__cloudprefix are rejected, andIncorrectDBInstanceAccountModeis returned.For sharded cluster instances,
CharacterTypeis required and must be set todborcs. If you set this parameter tonormalor leave it empty,InvalidCharacterTypeis returned.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dds:ResetAccountPassword |
update |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBInstanceId |
string |
Yes |
The instance ID. |
dds-bpxxxxxxxx |
| AccountName |
string |
Yes |
The name of the account whose password you want to reset. Set the value to root. |
root |
| AccountPassword |
string |
Yes |
The new password.
Note
For more information about how to handle special characters, see What do I do if the connection fails because the username or password in the connection string contains special characters? |
Ali!123456 |
| CharacterType |
string |
No |
The role type of the instance.
Valid values:
|
db |
| DBName |
string |
No |
The database to which the account belongs.
|
admin |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
06CBD06E-ABC9-4121-AB93-3C3820B3E7E6 |
Examples
Success response
JSON format
{
"RequestId": "06CBD06E-ABC9-4121-AB93-3C3820B3E7E6"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidAccountPassword.Malformed | Specified parameter AccountPassword is not valid. | The specified parameter AccountPassword is invalid. |
| 400 | InvalidAccountName.NotFound | The AccountName provided does not exist in our records. | |
| 400 | InvalidAccountName.Malformed | The specified parameter AccountName is not valid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.