SHOW ENCRYPT TABLE RULE

Description

The SHOW ENCRYPT RULE syntax is used to query encrypt rules for specified table in specified database.

Syntax

  1. ShowEncryptTableRule::=
  2. 'SHOW' 'ENCRYPT' 'TABLE' 'RULE' tabeName('FROM' databaseName)?
  3. tableName ::=
  4. identifier
  5. databaseName ::=
  6. 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 table in specified database.
  1. SHOW ENCRYPT TABLE RULE t_encrypt FROM test1;
  1. mysql> SHOW ENCRYPT TABLE RULE t_encrypt 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. +-----------+--------------+-----------------+---------------+------------------+--------------+-----------------+-----------------------+--------------------------+----------------+-------------------------+--------------------------+
  8. 2 rows in set (0.00 sec)
  • Query encrypt rules for specified table in current database.
  1. SHOW ENCRYPT TABLE RULE t_encrypt;
  1. mysql> SHOW ENCRYPT TABLE RULE t_encrypt;
  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. +-----------+--------------+-----------------+---------------+------------------+--------------+-----------------+-----------------------+--------------------------+----------------+-------------------------+--------------------------+
  8. 2 rows in set (0.00 sec)

Reserved word

SHOW, ENCRYPT, TABLE, RULE, FROM