• Query Rewrite Plugins


    [root@ZST1 ~] mysql --login-path=3306 </usr/local/mysql/share/install_rewriter.sql
    
    mydba@192.168.85.132,3306 [(none)]> create database qrp_drop;
    Query OK, 1 row affected (0.00 sec)
    
    mydba@192.168.85.132,3306 [(none)]> insert into query_rewrite.rewrite_rules(pattern,pattern_database,replacement) 
        -> values('select 3','qrp_drop','drop database qrp_drop');
    Query OK, 1 row affected (0.01 sec)
    
    mydba@192.168.85.132,3306 [(none)]> call query_rewrite.flush_rewrite_rules;
    Query OK, 0 rows affected (0.01 sec)
    
    mydba@192.168.85.132,3306 [(none)]> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | qrp_drop           |
    | query_rewrite      |
    | replcrash          |
    | sbtest             |
    | sys                |
    +--------------------+
    8 rows in set (0.00 sec)
    
    mydba@192.168.85.132,3306 [(none)]> select 3;
    Query OK, 0 rows affected, 1 warning (0.00 sec)
    
    mydba@192.168.85.132,3306 [(none)]> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | query_rewrite      |
    | replcrash          |
    | sbtest             |
    | sys                |
    +--------------------+
    7 rows in set (0.00 sec)
    
    mydba@192.168.85.132,3306 [(none)]> 
  • 相关阅读:
    mysql单机多实例配置
    mysql中FILE权限
    手把手教你用 Git(转)
    单例模式
    Java中的枚举Enum
    常见排序算法的亲手实现(代码与注释)
    Java中的位运算
    重载
    Java中的boxing和unboxing(转)
    Java的transient关键字(转)
  • 原文地址:https://www.cnblogs.com/ShanFish/p/8951954.html
Copyright © 2020-2023  润新知