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:
Parameters | Description | Required |
---|---|---|
user_name (str) | Username to be changed | Yes |
pwd (str) | New password | Yes |
change_meta (bool) | Whether to change metadata | No, defaults to False |
is_super (bool) | Whether this user is superuser | No, defaults to False |
can_create_role (bool) | Whether this user can create role | No, defaults to False |
can_create_db (bool) | Whether this user can create database | No, defaults to False |
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:
Parameters | Description | Required |
---|---|---|
new_password (str) | New password of the specified user | Yes |
user_name (str) | Name of user to change password, if not specified, the password of current user will be changed | No |