How to exact the data without duplication from mysql logs?

73 Views Asked by At

After I took a full backup of DB using mysqldump -u user -p database > backup.sql. After this I used

mysql> show master status;
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000002 | 80612155 |              |                  | 
+------------------+----------+--------------+------------------+

as it shows file,position,do db, ignore db after few changes on DB now the master status changes to

mysql> show master status;
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000002 | 80662157 |              |                  | 
+------------------+----------+--------------+------------------+

when I want take the incremental backup, how should I specify the start-position and stop-position. As mysql doc says "Start-position will Start reading the binary log at the first event having a position equal to or greater than N" and "Stop-position will Stop reading the binary log at the first event having a position equal to or greater than N". So how should I specify the positions to get data from binlog files after the full backup?

0

There are 0 best solutions below