Purpose
You can use this statement to change the verification method for enabling a role.
Note
User sessions where this role has been enabled are not affected.
Syntax
ALTER ROLE role_name
{ NOT IDENTIFIED
| IDENTIFIED BY password
} ;
Parameters
| Parameter | Description |
|---|---|
| role_name | The name of the role to be modified. |
| NOT IDENTIFIED | Indicates not using any verification method to enable the role. |
| IDENTIFIED BY password | The verification password for enabling the role. Note: A user granted this role must use the specified password for verification when attempting to enable the role by using the SET ROLE statement. |
Examples
Create a role named
role1and specify the password**1***for verification when this role is to be enabled.obclient> CREATE ROLE role1; Query OK, 0 rows affected obclient> ALTER ROLE role1 IDENTIFIED BY **1***; Query OK, 0 rows affectedChange the verification password of
role1to**2***.obclient> ALTER ROLE role1 IDENTIFIED BY **2***; Query OK, 0 rows affectedChange the verification method of
role1so that this role can be enabled without verification.obclient> ALTER ROLE role1 NOT IDENTIFIED; Query OK, 0 rows affected