SHOW ENCRYPT RULES

描述

SHOW ENCRYPT RULES 语法用于查询指定逻辑库中的数据加密规则。

语法

语法 铁路图

  1. ShowEncryptRule::=
  2. 'SHOW' 'ENCRYPT' ('RULES' | 'TABLE' 'RULE' ruleName) ('FROM' databaseName)?
  3. ruleName ::=
  4. identifier
  5. databaseName ::=
  6. identifier

补充说明

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

返回值说明

说明
table逻辑表名
logic_column逻辑列名
cipher_column密文列名
plain_column明文列名
assisted_query_column辅助查询列名
like_query_column模糊查询列名
encryptor_type加密算法类型
encryptor_props加密算法参数
assisted_query_type辅助查询算法类型
assisted_query_props辅助查询算法参数
like_query_type模糊查询算法类型
like_query_props模糊查询算法参数
query_with_cipher_column是否使用加密列进行查询

示例

  • 查询指定逻辑库中的数据加密规则
  1. SHOW ENCRYPT RULES FROM encrypt_db;
  1. mysql> SHOW ENCRYPT RULES FROM encrypt_db;
  2. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  3. | table | logic_column | cipher_column | plain_column | assisted_query_column | like_query_column | encryptor_type | encryptor_props | assisted_query_type | assisted_query_props | like_query_type | like_query_props | query_with_cipher_column |
  4. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  5. | t_user | pwd | pwd_cipher | pwd_plain | | | AES | aes-key-value=123456abc | | | | | true |
  6. | t_encrypt | pwd | pwd_cipher | pwd_plain | | | AES | aes-key-value=123456abc | | | | | true |
  7. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  8. 2 rows in set (0.00 sec)
  • 查询当前逻辑库中的数据加密规则
  1. SHOW ENCRYPT RULES;
  1. mysql> SHOW ENCRYPT RULES;
  2. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  3. | table | logic_column | cipher_column | plain_column | assisted_query_column | like_query_column | encryptor_type | encryptor_props | assisted_query_type | assisted_query_props | like_query_type | like_query_props | query_with_cipher_column |
  4. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  5. | t_user | pwd | pwd_cipher | pwd_plain | | | AES | aes-key-value=123456abc | | | | | true |
  6. | t_encrypt | pwd | pwd_cipher | pwd_plain | | | AES | aes-key-value=123456abc | | | | | true |
  7. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  8. 2 rows in set (0.00 sec)
  • 查询指定逻辑库中指定的数据加密规则
  1. SHOW ENCRYPT TABLE RULE t_encrypt FROM encrypt_db;
  1. mysql> SHOW ENCRYPT TABLE RULE t_encrypt FROM encrypt_db;
  2. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  3. | table | logic_column | cipher_column | plain_column | assisted_query_column | like_query_column | encryptor_type | encryptor_props | assisted_query_type | assisted_query_props | like_query_type | like_query_props | query_with_cipher_column |
  4. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  5. | t_encrypt | pwd | pwd_cipher | pwd_plain | | | AES | aes-key-value=123456abc | | | | | true |
  6. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  7. 1 row in set (0.01 sec)
  • 查询当前逻辑库中指定的数据加密规则
  1. SHOW ENCRYPT TABLE RULE t_encrypt;
  1. mysql> SHOW ENCRYPT TABLE RULE t_encrypt;
  2. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  3. | table | logic_column | cipher_column | plain_column | assisted_query_column | like_query_column | encryptor_type | encryptor_props | assisted_query_type | assisted_query_props | like_query_type | like_query_props | query_with_cipher_column |
  4. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  5. | t_encrypt | pwd | pwd_cipher | pwd_plain | | | AES | aes-key-value=123456abc | | | | | true |
  6. +-----------+--------------+---------------+--------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+--------------------------+
  7. 1 row in set (0.01 sec)

保留字

SHOWENCRYPTTABLERULERULESFROM

相关链接