Note
This variable is available starting with V4.4.2 BP2.
Overview
caching_sha2_password_digest_rounds specifies the number of SHA-256 iterations performed before a password is hashed and stored to disk when the caching_sha2_password authentication plugin is used.
Privilege requirements
Query variables
Global level
The
SHOW VARIABLESstatement, or theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (in Oracle-compatible mode) and theinformation_schema.GLOBAL_VARIABLESview (in MySQL-compatible mode), can be used by thesystenant and all user tenants to view the values of global system variables.
Modify variables
Global effective
The
systenant can directly modify the values of global system variables.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the values of global system variables.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Int |
| Default Value | 5000 |
| Value range | [5000, 4095000], and must be a multiple of 1000 |
| Effective Scope | Global |
| Modifiable | Yes, you can use the following methods:SETStatement modification. |
Usage instructions
This variable controls the number of SHA256 iterations performed before a password is hashed and stored to disk when using the caching_sha2_password authentication plugin. Increasing the number of iterations enhances password hash security but also increases the computational overhead for password verification. This variable allows users to balance security and performance. After modifying this variable, newly created passwords will use the new iteration count, but existing password hashes will not be affected.
Configuration example
Set the number of SHA256 iterations for password hashing to 10,000.
Effective globally
obclient> SET GLOBAL caching_sha2_password_digest_rounds = 10000;
