Not the answer you need?
Register and ask your own question!

pt-table-sync script

mageshkumar24mageshkumar24 EntrantCurrent User Role Supporter
Hi All,

I am working on master-slave replication.
Some how two table in slave are showing the difference when i ran pt-table-chekcsum.

The two tables which are having difference doesn't have unique index or primary key.
i am getting follwoing error while running the table sync for one of the two tables.

Can't make changes on the master because no unique index exists at /usr/bin/pt-table-sync line 9241.

The pt-table-sync syntax i used is listed as follows:

pt-table-sync --print --sync-to-master --no-check-trigger --no-foreign-key-checks --replicate percona.checksum h="slave_host_name",P=port_no,D="DB _NAME",t="TABLE_NAME ",u="username",p="password&quo t;.

later i found the option --no-check-slave can be used if no unique index are present on a table.

pt-table-sync --print --sync-to-master --no-check-trigger --no-foreign-key-checks --replicate percona.checksum --no-check-slave h="slave_host_name",P=port_no,D="DB _NAME",t="TABLE_NAME ",u="username",p="password&quo t;.

Can some one please help with this issue.. ....


  • niljoshiniljoshi MySQL Sage Inactive User Role Beginner
    Hi Magesh,

    As per the documentation, "When there is no unique key on the table, there is no choice but to change the data on the slave, and pt-table-sync will detect that you're trying to do so. It will complain and die unless you specify --no-check-slave" .html

    Generally, its unsafe to make changes on slave directly but if you don't have any other way, you have to use --no-check-slave option. Because by default, pt-table-sync will always give error when there is no unique index on table.

    Have you tried to use that option? are you facing any issue with that?
  • mageshkumar24mageshkumar24 Entrant Current User Role Supporter
    Hello Joshi,

    I am trying to this delete this entire post, but not able to do so.
    since these post have few sensitive information i request you to delete this entire post.
    can you please remove this post
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.