I have a table XXX, this table has on all 3 nodes different number of records. This table uses auto_increment key.
I wish to resync this table from master to slaves.
# yum install https://www.percona.com/downloads/percona-toolkit/2.2.16/RPM/percona-toolkit-2.2.16-1.noarch.rpm
# pt-table-sync --print --replicate=XXX.XXX --sync-to-master h=localhost,u=root,p=were4rzerzhghethget45e5tergd
Failed to /*!50108 SET @@binlog_format := 'STATEMENT'*/: DBD::mysql::db do failed: Variable 'binlog_format' can't be set to the value of 'STATEMENT' [for Statement "/*!50108 SET @@binlog_format := 'STATEMENT'*/"] at /usr/bin/pt-table-sync line 10841.
This tool requires binlog_format=STATEMENT, but the current binlog_format is set to ROW and an error occurred while attempting to change it. If running MySQL 5.1.29 or newer, setting binlog_format requires the SUPER privilege. You will need to manually set binlog_format to 'STATEMENT' before running this tool.
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle ;host=localhost;mysql_read_default_group=client at /usr/bin/pt-table-sync line 10844.
> SET SESSION binlog_format=STATEMENT;
ERROR 1231 (42000): Variable 'binlog_format' can't be set to the value of 'STATEMENT'
> show errors;
+-------+------+-------------------------------------------------------------------+
| Level | Code | Message |
+-------+------+-------------------------------------------------------------------+
| Error | 1231 | Variable 'binlog_format' can't be set to the value of 'STATEMENT' |
+-------+------+-------------------------------------------------------------------+
1 row in set (0.00 sec)
There is a bug report which explains this issue.
Is there an other way to sync tables?