简体   繁体   中英

Binary Log MySQL

I have some binary log files from localhost but when i write

     mysqlbinlog mysql-bin.000001 > statament.sql

or a text file it just returns gibberish ie

    /*!40019 SET @@session.max_insert_delayed_threads=0*/;
    /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
    DELIMITER /*!*/;
    # at 4
    #120919 11:08:54 server id 1  end_log_pos 106   Start: binlog v 4, server v 5.1.33-        community-log created 120919 11:08:54 at startup
    ROLLBACK/*!*/;
    BINLOG '
    potZUA8BAAAAZgAAAGoAAAAAAAQANS4xLjMzLWNvbW11bml0eS1sb2cAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAACmi1lQEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
    '/*!*/;
    # at 106
    #120919 11:26:07 server id 1  end_log_pos 125   Stop
    DELIMITER ;
    # End of log file
    ROLLBACK /* added by mysqlbinlog */;
    /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;

So that is mainly what is bothering... I have not slaves set up ... any idea what I'm doing wrong ?

Thanks !

MySQL binary log by definition is logging the data manipulations in binary form to save time and space for processing. So when you examine them, you should add --base64-output=decode-rows option to mysqlbinlog client have the the output decoded.

you can use this :

mysqlbinlog --no-defaults --base64-output=decode-rows -v mysql-bin.000001 > statament.sql

Instead of --no-defaults --base64-output=decode-row -v

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM