SHOW SHADOW RULE
语法用于查询指定逻辑库中的影子规则。
ShowEncryptRule::=
'SHOW' 'SHADOW' ('RULES' | 'RULE' shadowRuleName) ('FROM' databaseName)?
shadowRuleName ::=
identifier
databaseName ::=
identifier
databaseName
时,默认是当前使用的 DATABASE
。 如果也未使用 DATABASE
则会提示 No database selected
。列 | 说明 |
---|---|
rule_name | 规则名称 |
source_name | 数据源名称 |
shadow_name | 影子数据源名称 |
shadow_table | 影子表 |
SHOW SHADOW RULE shadow_rule FROM shadow_db;
mysql> SHOW SHADOW RULE shadow_rule FROM shadow_db;
+-------------+-------------+-------------+----------------------+
| rule_name | source_name | shadow_name | shadow_table |
+-------------+-------------+-------------+----------------------+
| shadow_rule | ds_0 | ds_1 | t_order_item,t_order |
+-------------+-------------+-------------+----------------------+
1 row in set (0.00 sec)
SHOW SHADOW RULE shadow_rule;
mysql> SHOW SHADOW RULE shadow_rule;
+-------------+-------------+-------------+----------------------+
| rule_name | source_name | shadow_name | shadow_table |
+-------------+-------------+-------------+----------------------+
| shadow_rule | ds_0 | ds_1 | t_order_item,t_order |
+-------------+-------------+-------------+----------------------+
1 row in set (0.01 sec)
SHOW SHADOW RULES FROM shadow_db;
mysql> SHOW SHADOW RULES FROM shadow_db;
+-------------+-------------+-------------+----------------------+
| rule_name | source_name | shadow_name | shadow_table |
+-------------+-------------+-------------+----------------------+
| shadow_rule | ds_0 | ds_1 | t_order_item,t_order |
+-------------+-------------+-------------+----------------------+
1 row in set (0.00 sec)
SHOW SHADOW RULES;
mysql> SHOW SHADOW RULES;
+-------------+-------------+-------------+----------------------+
| rule_name | source_name | shadow_name | shadow_table |
+-------------+-------------+-------------+----------------------+
| shadow_rule | ds_0 | ds_1 | t_order_item,t_order |
+-------------+-------------+-------------+----------------------+
1 row in set (0.00 sec)
SHOW
、SHADOW
、RULE
、RULES
、FROM