zoukankan      html  css  js  c++  java
  • 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)]> 
  • 相关阅读:
    go语言——strings和strconv
    go语言——map
    Manjaro配置
    go语言——数组和切片
    go语言——随机数
    go——选择和循环
    go语言——输入输出
    java动态代理实现--基于子类的动态代理
    java动态代理实现--基于接口的动态代理
    spring依赖注入
  • 原文地址:https://www.cnblogs.com/ShanFish/p/8951954.html
Copyright © 2011-2022 走看看