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>

     

  • 相关阅读:
    「自己开发直播」实现nginx-rtmp-module多频道输入输出与权限控制
    抢购代码留存
    抢红包代码留存
    Table '' is marked as crashed and should be repaired 解决方法
    extundelete实现Linux下文件/文件夹数据恢复!
    RedHat设置Yum源
    MFC 自定义消息
    单例模式
    工厂模式(转)
    hash_map
  • 原文地址:https://www.cnblogs.com/igoodful/p/9055325.html
Copyright © 2011-2022 走看看