[root@ZST1 ~] mysql --login-path= </usr/local/mysql/share/install_rewriter.sql [email protected], [(none)]> create database qrp_drop;
Query OK, row affected (0.00 sec) [email protected], [(none)]> insert into query_rewrite.rewrite_rules(pattern,pattern_database,replacement)
-> values('select 3','qrp_drop','drop database qrp_drop');
Query OK, row affected (0.01 sec) [email protected], [(none)]> call query_rewrite.flush_rewrite_rules;
Query OK, rows affected (0.01 sec) [email protected], [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| qrp_drop |
| query_rewrite |
| replcrash |
| sbtest |
| sys |
+--------------------+
rows in set (0.00 sec) [email protected], [(none)]> select ;
Query OK, rows affected, warning (0.00 sec) [email protected], [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| query_rewrite |
| replcrash |
| sbtest |
| sys |
+--------------------+
rows in set (0.00 sec) [email protected], [(none)]>