COUNT ENCRYPT RULE

Description

The COUNT ENCRYPT RULE syntax is used to query the number of encrypt rules for specified database.

Syntax

Grammar Railroad diagram

  1. CountEncryptRule::=
  2. 'COUNT' 'ENCRYPT' 'RULE' ('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
rule_namerule type
databasethe database to which the rule belongs
countthe number of the rule

Example

  • Query the number of encrypt rules for specified database.
  1. COUNT ENCRYPT RULE FROM encrypt_db;
  1. mysql> COUNT ENCRYPT RULE FROM encrypt_db;
  2. +-----------+---------------+-------+
  3. | rule_name | database | count |
  4. +-----------+---------------+-------+
  5. | encrypt | encrypt_db | 2 |
  6. +-----------+---------------+-------+
  7. 1 row in set (0.01 sec)
  • Query the number of encrypt rules for current database.
  1. COUNT ENCRYPT RULE;
  1. mysql> COUNT ENCRYPT RULE;
  2. +-----------+---------------+-------+
  3. | rule_name | database | count |
  4. +-----------+---------------+-------+
  5. | encrypt | encrypt_db | 2 |
  6. +-----------+---------------+-------+
  7. 1 row in set (0.01 sec)

Reserved word

COUNT, ENCRYPT, RULE, FROM