When debugging the replication process, it's important to review the binary log content. MySQL provides the mysqlbinlog utility to help examine the content in the log files.
> mysqlbinlog "C:\ProgramData\MySQL\MySQL Server 5.5\data\bin.000003"
The following is an example output:
> mysqlbinlog "C:\ProgramData\MySQL\MySQL Server 5.5\data\bin.000003"
The following is an example output:
>mysqlbinlog "C:\ProgramData\MySQL\MySQL Server 5.5\data\bin.000003" /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at 4 #130820 22:56:58 server id 1 end_log_pos 107 Start: binlog v 4, server v 5.5.33-log created 13082022:56:58 BINLOG 'mkgUUg8BAAAAZwAAAGsAAAAAAAQANS41LjMzLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA== '/*!*/; # at 107 #130820 23:06:51 server id 1 end_log_pos 176 Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1377061611/*!*/; SET @@session.pseudo_thread_id=1/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.uniq ue_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=1344274432/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=33/*!*/; SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; # at 176 # at 221 #130820 23:06:51 server id 1 end_log_pos 221 Table_map: `mysql`.`foo` mapped to number 33 #130820 23:06:51 server id 1 end_log_pos 255 Write_rows: table id 33 flags: STMT_END_FBINLOG ' 60oUUhMBAAAALQAAAN0AAAAAACEAAAAAAAEABW15c3FsAANmb28AAf4C/h4B 60oUUhcBAAAAIgAAAP8AAAAAACEAAAAAAAEAAf/+A2Jhcg=='/*!*/; # at 255 #130820 23:06:51 server id 1 end_log_pos 282 Xid = 8 COMMIT/*!*/; # at 282 #130820 23:06:58 server id 1 end_log_pos 319 Rotate to bin.000004 pos: 4 DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
The output includes information (time the query took, id of the thread which issued it, timestamp when it was issued etc).
(Created 8/20/2013)