Wednesday, June 23, 2010

Troubleshooting MySQL Replication with mysqlbinlog



[root@vmxdb01 mysql]# mysqlbinlog mysql-bin.000002


SET TIMESTAMP=1277302367/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
insert into employees values('a','b',1)
/*!*/;
# at 1053
#100623 22:33:07 server id 1 end_log_pos 1154 Query thread_id=4 exec_time=0 error_code=0
SET TIMESTAMP=1277303587/*!*/;
insert into employees values('b','c',2)
/*!*/;
# at 1154
#100623 22:42:34 server id 1 end_log_pos 1255 Query thread_id=4 exec_time=0 error_code=0
SET TIMESTAMP=1277304154/*!*/;
insert into employees values('b','c',3)
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;





[root@vmxdb01 mysql]# mysql -h vmxdb01 -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.0.77-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select from_unixtime(1277304154);
+---------------------------+
| from_unixtime(1277304154) |
+---------------------------+
| 2010-06-23 22:42:34 |
+---------------------------+
1 row in set (0.00 sec)

mysql> exit
Bye