zoukankan      html  css  js  c++  java
  • mysqlbinlog

    1、查看远程服务器上的二进制日志文件:这里

    mysqlbinlog -R -h192.168.1.101 -uroot -p123456 mysql-bin.000036 > igoodful.sql

    2、指定位置点。start <= pos < end

    3、指定时间。

    4、mysqlbinlog --base64-output=DECODE-ROWS  -v -v mysql-bin.000776|less

    #  那么能否看到原始SQL语句呢?答案是可以,但是必须设置系统变量binlog_rows_query_log_events

    mysql> show variables like 'binlog_rows_query_log_events';
    
    +------------------------------+-------+
    
    | Variable_name                | Value |
    
    +------------------------------+-------+
    
    | binlog_rows_query_log_events | OFF   |
    
    +------------------------------+-------+
    
    1 row in set (0.00 sec)
    
     
    
    mysql> set binlog_rows_query_log_events=1;
    
    Query OK, 0 rows affected (0.00 sec)
    
     
    
    mysql> flush logs;
    
    Query OK, 0 rows affected (0.01 sec)
    
     
    
    mysql>  show master status;
    
    +----------------------+----------+--------------+------------------+-------------------+
    
    | File                 | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
    
    +----------------------+----------+--------------+------------------+-------------------+
    
    | DB-Server-bin.000026 |      120 |              |                  |                   |
    
    +----------------------+----------+--------------+------------------+-------------------+
    
    1 row in set (0.00 sec)
    
     
    
    mysql>

     

  • 相关阅读:
    Spring:@ConfigurationProperties配置绑定
    Linux:性能诊断
    【第二章】:深浅拷贝剖析
    【第二章】:模块和运算符
    python 扩展注册功能装饰器举例
    python 函数 之 用户注册register()
    python 之 函数 基础
    python 函数
    python 文件操作
    python 的 数据类型
  • 原文地址:https://www.cnblogs.com/igoodful/p/9055325.html
Copyright © 2011-2022 走看看