Alter User

changed = hc.change_user_info(user_name = "test_user", pwd = "password123", is_super = True)

Result:

This method returns a Boolean value to represent whether this operation is successful. If the error pops up when altering user, “ValueError” exception will be raised.

Parameter description:

ParametersDescriptionRequired
user_name (str)Username to be changedYes
pwd (str)New passwordYes
change_meta (bool)Whether to change metadataNo, defaults to False
is_super (bool)Whether this user is superuserNo, defaults to False
can_create_role (bool)Whether this user can create roleNo, defaults to False
can_create_db (bool)Whether this user can create databaseNo, defaults to False
Table 88 Alter User (Python API)

Change User Password

changed = hc.change_password(new_password = "another_new_password123", user_name = "test_user")

Result:

This method returns a Boolean value to represent whether this operation is successful. If the error pops up when changing password, “ValueError” exception will be raised.

Parameter description:

ParametersDescriptionRequired
new_password (str)New password of the specified userYes
user_name (str)Name of user to change password, if not specified, the password of current user will be changedNo
Table 89 Change User Password (Python API)