SHOW ENCRYPT RULES

Description

The SHOW ENCRYPT RULES syntax is used to query encryption rules for a specified database.

Syntax

Grammar Railroad diagram

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

Note

  • When databaseName is not specified, then DATABASEis currently used as the default name. If DATABASE is not used, you will receive a No database selected prompt.

Return value description

ColumnDescription
tableLogical table name
logic_columnLogical column name
cipher_columnCiphertext column name
assisted_query_columnAssisted query column name
like_query_columnLike query column name
encryptor_typeEncryption algorithm type
encryptor_propsEncryption algorithm parameter
assisted_query_typeAssisted query algorithm type
assisted_query_propsAssisted query algorithm parameter
like_query_typeLike query algorithm type
like_query_propsLike query algorithm parameter

Example

  • Query encrypt rules for specified database.
  1. SHOW ENCRYPT RULES FROM encrypt_db;
  1. mysql> SHOW ENCRYPT RULES FROM encrypt_db;
  2. +-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
  3. | table | logic_column | cipher_column | assisted_query_column | like_query_column | encryptor_type | encryptor_props | assisted_query_type | assisted_query_props | like_query_type | like_query_props |
  4. +-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
  5. | t_user | pwd | pwd_cipher | | | AES | aes-key-value=123456abc | | | | |
  6. | t_encrypt | pwd | pwd_cipher | | | AES | aes-key-value=123456abc | | | | |
  7. +-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
  8. 2 rows in set (0.00 sec)
  • Query encrypt rules for current database.
  1. SHOW ENCRYPT RULES;
  1. mysql> SHOW ENCRYPT RULES;
  2. +-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
  3. | table | logic_column | cipher_column | assisted_query_column | like_query_column | encryptor_type | encryptor_props | assisted_query_type | assisted_query_props | like_query_type | like_query_props |
  4. +-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
  5. | t_user | pwd | pwd_cipher | | | AES | aes-key-value=123456abc | | | | |
  6. | t_encrypt | pwd | pwd_cipher | | | AES | aes-key-value=123456abc | | | | |
  7. +-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
  8. 2 rows in set (0.00 sec)
  • Query specified encrypt rule in specified database.
  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 | assisted_query_column | like_query_column | encryptor_type | encryptor_props | assisted_query_type | assisted_query_props | like_query_type | like_query_props |
  4. +-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
  5. | t_encrypt | pwd | pwd_cipher | | | AES | aes-key-value=123456abc | | | | |
  6. +-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
  7. 1 row in set (0.01 sec)
  • Query specified encrypt rule in current database.
  1. SHOW ENCRYPT TABLE RULE t_encrypt;
  1. mysql> SHOW ENCRYPT TABLE RULE t_encrypt;
  2. +-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
  3. | table | logic_column | cipher_column | assisted_query_column | like_query_column | encryptor_type | encryptor_props | assisted_query_type | assisted_query_props | like_query_type | like_query_props |
  4. +-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
  5. | t_encrypt | pwd | pwd_cipher | | | AES | aes-key-value=123456abc | | | | |
  6. +-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
  7. 1 row in set (0.01 sec)

Reserved word

SHOW, ENCRYPT, TABLE, RULE, RULES, FROM