Note
This variable is available starting with V4.6.1.
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
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement, or theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (in Oracle-compatible mode) and theinformation_schema.GLOBAL_VARIABLESview (in MySQL-compatible mode), 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 values of global system variables.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 SET statement to modify this variable. |
Usage instructions
This variable controls the number of SHA-256 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 SHA-256 iterations for password hashing to 10000.
Effective globally
obclient> SET GLOBAL caching_sha2_password_digest_rounds = 10000;
