Documentation Home
MySQL 9.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 41.8Mb
PDF (A4) - 41.9Mb
Man Pages (TGZ) - 272.4Kb
Man Pages (Zip) - 378.4Kb
Info (Gzip) - 4.2Mb
Info (Zip) - 4.2Mb


MySQL 9.7 Reference Manual  /  ...  /  SHOW CREATE MASKING POLICY Statement

15.7.7.11 SHOW CREATE MASKING POLICY Statement

    SHOW CREATE MASKING POLICY policy_name;

SHOW CREATE MASKING POLICY shows the statement that created the named masking policy. To use this statement, you must have the MANAGE_DATA_MASKING_POLICY privilege, and the object_policy component must be loaded. The named policy must exist. If either condition is not met, an error is returned.

The statement prints the policy name and argument name using the lettercase specified when the policy was created.

mysql> SHOW CREATE MASKING POLICY mask_password\G
*************************** 1. row ***************************
           Masking Policy: mask_password
Create Masking Policy: CREATE MASKING POLICY `mask_password`(`pass_column`)
    CASE WHEN CURRENT_ROLE_IN('admin')
         THEN `pass_column`
         ELSE SHA2(`pass_column`, 256)
    END