Retro Eye care Haitian Deep Dark Default

SHOW ENCRYPT RULES

Description

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

Syntax

ShowEncryptRule::=
  'SHOW' 'ENCRYPT' ('RULES' | 'TABLE' 'RULE' ruleName) ('FROM' databaseName)?

ruleName ::=
  identifier

databaseName ::=
  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

Column Description
table Logical table name
logic_column Logical column name
cipher_column Ciphertext column name
assisted_query_column Assisted query column name
like_query_column Like query column name
encryptor_type Encryption algorithm type
encryptor_props Encryption algorithm parameter
assisted_query_type Assisted query algorithm type
assisted_query_props Assisted query algorithm parameter
like_query_type Like query algorithm type
like_query_props Like query algorithm parameter

Example

  • Query encrypt rules for specified database.
SHOW ENCRYPT RULES FROM encrypt_db;
mysql> SHOW ENCRYPT RULES FROM encrypt_db;
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
| 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 |
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
| t_user    | pwd          | pwd_cipher    |                       |                   | AES            | aes-key-value=123456abc, digest-algorithm-name=SHA-1 |                     |                      |                 |                  |
| t_encrypt | pwd          | pwd_cipher    |                       |                   | AES            | aes-key-value=123456abc, digest-algorithm-name=SHA-1 |                     |                      |                 |                  |
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
2 rows in set (0.00 sec)
  • Query encrypt rules for current database.
SHOW ENCRYPT RULES;
mysql> SHOW ENCRYPT RULES;
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
| 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 |
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
| t_user    | pwd          | pwd_cipher    |                       |                   | AES            | aes-key-value=123456abc, digest-algorithm-name=SHA-1 |                     |                      |                 |                  |
| t_encrypt | pwd          | pwd_cipher    |                       |                   | AES            | aes-key-value=123456abc, digest-algorithm-name=SHA-1 |                     |                      |                 |                  |
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
2 rows in set (0.00 sec)
  • Query specified encrypt rule in specified database.
SHOW ENCRYPT TABLE RULE t_encrypt FROM encrypt_db;
mysql> SHOW ENCRYPT TABLE RULE t_encrypt FROM encrypt_db;
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
| 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 |
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
| t_encrypt | pwd          | pwd_cipher    |                       |                   | AES            | aes-key-value=123456abc, digest-algorithm-name=SHA-1 |                     |                      |                 |                  |
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
1 row in set (0.01 sec)
  • Query specified encrypt rule in current database.
SHOW ENCRYPT TABLE RULE t_encrypt;
mysql> SHOW ENCRYPT TABLE RULE t_encrypt;
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
| 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 |
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
| t_encrypt | pwd          | pwd_cipher    |                       |                   | AES            | aes-key-value=123456abc, digest-algorithm-name=SHA-1 |                     |                      |                 |                  |
+-----------+--------------+---------------+-----------------------+-------------------+----------------+-------------------------+---------------------+----------------------+-----------------+------------------+
1 row in set (0.01 sec)

Reserved word

SHOW, ENCRYPT, TABLE, RULE, RULES, FROM