SHOW ENCRYPT RULES

Description

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

Syntax

  1. ShowEncryptRule::=
  2. 'SHOW' 'ENCRYPT' 'RULES' ('FROM' databaseName)?
  3. databaseName ::=
  4. identifier

Supplement

  • When databaseName is not specified, the default is the currently used DATABASE. If DATABASE is not used, No database selected will be prompted.

Return value description

ColumnDescription
tableLogical table name
logic_columnLogical column name
logic_data_typeLogical column data type
cipher_columnCiphertext column name
cipher_data_typeCiphertext column data type
plain_columnPlaintext column name
plain_data_typePlaintext column data type
assisted_query_columnAssisted query column name
assisted_query_data_typeAssisted query column data type
encryptor_typeEncryption algorithm type
encryptor_propsEncryption algorithm parameter
query_with_cipher_columnWhether to use encrypted column for query

Example

  • Query encrypt rules for specified database.
  1. SHOW ENCRYPT RULES FROM test1;
  1. mysql> SHOW ENCRYPT RULES FROM test1;
  2. +-------------+--------------+-----------------+---------------+------------------+--------------+-----------------+-----------------------+--------------------------+----------------+-------------------------+--------------------------+
  3. | table | logic_column | logic_data_type | cipher_column | cipher_data_type | plain_column | plain_data_type | assisted_query_column | assisted_query_data_type | encryptor_type | encryptor_props | query_with_cipher_column |
  4. +-------------+--------------+-----------------+---------------+------------------+--------------+-----------------+-----------------------+--------------------------+----------------+-------------------------+--------------------------+
  5. | t_encrypt | user_id | | user_cipher | | user_plain | | | | AES | aes-key-value=123456abc | true |
  6. | t_encrypt | order_id | | order_cipher | | | | | | MD5 | | true |
  7. | t_encrypt_2 | user_id | | user_cipher | | user_plain | | | | AES | aes-key-value=123456abc | false |
  8. | t_encrypt_2 | order_id | | order_cipher | | | | | | MD5 | | false |
  9. +-------------+--------------+-----------------+---------------+------------------+--------------+-----------------+-----------------------+--------------------------+----------------+-------------------------+--------------------------+
  10. 4 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 | logic_data_type | cipher_column | cipher_data_type | plain_column | plain_data_type | assisted_query_column | assisted_query_data_type | encryptor_type | encryptor_props | query_with_cipher_column |
  4. +-------------+--------------+-----------------+---------------+------------------+--------------+-----------------+-----------------------+--------------------------+----------------+-------------------------+--------------------------+
  5. | t_encrypt | user_id | | user_cipher | | user_plain | | | | AES | aes-key-value=123456abc | true |
  6. | t_encrypt | order_id | | order_cipher | | | | | | MD5 | | true |
  7. | t_encrypt_2 | user_id | | user_cipher | | user_plain | | | | AES | aes-key-value=123456abc | false |
  8. | t_encrypt_2 | order_id | | order_cipher | | | | | | MD5 | | false |
  9. +-------------+--------------+-----------------+---------------+------------------+--------------+-----------------+-----------------------+--------------------------+----------------+-------------------------+--------------------------+
  10. 4 rows in set (0.00 sec)

Reserved word

SHOW, ENCRYPT, RULES, FROM