SHOW MASK RULES

    语法

    • 未指定 databaseName 时,默认是当前使用的 DATABASE, 如果也未使用 DATABASE 则会提示 No database selected

    返回值说明

    • 查询指定逻辑库中的所有数据脱敏规则
    1. SHOW MASK RULES FROM mask_db;
    1. mysql> SHOW MASK RULES FROM mask_db;
    2. +---------+----------+------------------+--------------------------------+
    3. | table | column | algorithm_type | algorithm_props |
    4. +---------+----------+------------------+--------------------------------+
    5. | t_mask | address | MD5 | |
    6. | t_order | order_id | MD5 | |
    7. +---------+----------+------------------+--------------------------------+
    8. 4 rows in set (0.01 sec)
    • 查询当前逻辑库中的所有数据脱敏规则
    1. mysql> SHOW MASK RULES;
    2. +---------+----------+------------------+--------------------------------+
    3. | table | column | algorithm_type | algorithm_props |
    4. +---------+----------+------------------+--------------------------------+
    5. | t_mask | phoneNum | MASK_FROM_X_TO_Y | to-y=2,replace-char=*,from-x=1 |
    6. | t_mask | address | MD5 | |
    7. | t_order | order_id | MD5 | |
    8. | t_user | user_id | MASK_FROM_X_TO_Y | to-y=2,replace-char=*,from-x=1 |
    9. 4 rows in set (0.01 sec)
    • 查询指定逻辑库中的指定数据脱敏算法
    • 查询当前逻辑库中的指定数据脱敏算法
    1. SHOW MASK RULE t_mask;
    1. mysql> SHOW MASK RULE t_mask;
    2. +--------+--------------+------------------+--------------------------------+
    3. | table | logic_column | mask_algorithm | props |
    4. +--------+--------------+------------------+--------------------------------+
    5. | t_mask | phoneNum | MASK_FROM_X_TO_Y | to-y=2,replace-char=*,from-x=1 |
    6. | t_mask | address | MD5 | |
    7. +--------+--------------+------------------+--------------------------------+
    8. 2 rows in set (0.00 sec)

    保留字