zoukankan      html  css  js  c++  java
  • MySQL binlog 导入

    1. 转换为SQL

    mysqlbinlog -v  --base64-output=decode-rows --skip-gtids=true -d db1  mysql-bin.003513 > db1.sql

    -d: 指定数据库

    --skip-gtids:  跳过gtids

    转换后的文件内容样例:

    BEGIN
    /*!*/;
    # at 28780088
    #200730 17:04:29 server id 3304445132  end_log_pos 28780173 CRC32 0x85c63a2f    Table_map: `test_master`.`item_stock_io_record` mapped to number 5964
    # at 28780173
    #200730 17:04:29 server id 3304445132  end_log_pos 28780307 CRC32 0x91f48ce0    Write_rows: table id 5964 flags: STMT_END_F
    ### INSERT INTO `test_master`.`item_stock_io_record`
    ### SET
    ###   @1='000001739eec131700007d09'
    ###   @2='0000016bcfa5566300000e6a'
    ###   @3=1000
    ###   @4=0
    ###   @5=0
    ###   @6=1596099138327
    ###   @7=1596099138327
    ###   @8=0
    ###   @9=0
    # at 28780307
    #200730 17:04:29 server id 3304445132  end_log_pos 28780338 CRC32 0x750e5180    Xid = 5452960571
    COMMIT/*!*/;
    # at 28780338
    # at 28780403
    #200730 17:04:29 server id 3304445132  end_log_pos 28780487 CRC32 0x04ead87d    Query   thread_id=11643976      exec_time=0     error_code=0
    SET TIMESTAMP=1596099869/*!*/;

    2. 导入数据库

    mysql -f -h192.168.0.101 -udbuser1 -ptest123 db1 < db1.sql

    -f: 忽略SQL错误

  • 相关阅读:
    Could not load file or assembly 'System.Core, Version=2.0.5.0
    r 数据分组处理
    r函数知识总结
    R-Sys.time计算程序运行时间
    R语言包_dplyr_1
    R语言系列:生成数据
    R语言-分组统计
    导数——平均变化率与瞬时变化率
    梯度下降法
    梯度
  • 原文地址:https://www.cnblogs.com/got-my-way/p/13412450.html
Copyright © 2011-2022 走看看