# Mysql 5.7 replication failure

**URL:** <https://forums.percona.com/t/mysql-5-7-replication-failure/12511>\
**Category:** MySQL & MariaDB\
**Tags:** mysql\
**Created:** [October 11, 2021, 7:39am UTC](https://forums.percona.com/t/mysql-5-7-replication-failure/12511 "2021-10-11T07:39:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bKumar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/bkumar/32/8989_2.png) [@bKumar](https://forums.percona.com/u/bKumar)\
**Post date:** [October 11, 2021, 7:39am UTC](https://forums.percona.com/t/mysql-5-7-replication-failure/12511/1 "2021-10-11T07:39:34Z")

</div>

Hi everyone,

I got an issue in mysql 5.7 master slave replication error.

Can you please help in resolving this.

Steps I followed o resetup of slave with master data.

1. I took dump of master data with mysqldump --single-transaction --master-data=2 --all-databases --routines --triggers --events \> dump.sql
2. Imported the dump file in slave
3. Reset slave all; on slave machine I did
4. Got the new master file and position from dump file using  
head -28 dump.sql
5. Change master to master\_host=xxx, master\_port=xxx,master\_user=xxx,master\_password=xxx, master\_delay=86400, master\_log\_file=xxx, master\_log\_position=xxx;
6. Start slave ; on slave machine

But the replication is failed with 1062 duplicate error.  
I Cross checked the master log file and position from dump file, I verified the error logs.

Nothing helped.

Can you please help me to resolve this.

Thanks  
Kumar

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [October 11, 2021, 4:51pm UTC](https://forums.percona.com/t/mysql-5-7-replication-failure/12511/2 "2021-10-11T16:51:04Z")

</div>

Have you tried this without the master\_delay option?

---

<div class="post-metadata">

**Author:** ![bKumar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/bkumar/32/8989_2.png) [@bKumar](https://forums.percona.com/u/bKumar)\
**Post date:** [October 11, 2021, 4:55pm UTC](https://forums.percona.com/t/mysql-5-7-replication-failure/12511/3 "2021-10-11T16:55:10Z")

</div>

Hi mattheab,

No I didn’t tried without master\_delay, can you please help me how it different.

Thanks  
Kumar

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [October 11, 2021, 5:13pm UTC](https://forums.percona.com/t/mysql-5-7-replication-failure/12511/4 "2021-10-11T17:13:09Z")

</div>

Run the same change master command as you have, but remove the master\_delay parameter. Simple. Also, please confirm that all of your tables are InnoDB engine?

---

<div class="post-metadata">

**Author:** ![zhouke](https://avatars.discourse-cdn.com/v4/letter/z/3bc359/32.png) [@zhouke](https://forums.percona.com/u/zhouke)\
**Post date:** [October 23, 2021, 1:46pm UTC](https://forums.percona.com/t/mysql-5-7-replication-failure/12511/5 "2021-10-23T13:46:27Z")

</div>

Hey, bKumar

I experienced the same error you faced, the reason is that there is a few myisam engine tables on the master,so please check the error message(run the show slave status on the slave can display the error message)to make sure if the error is associated with myisam table.making all application tables are InnoDB engine and resetup a slave

---

<div class="post-metadata">

**Author:** ![bKumar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/bkumar/32/8989_2.png) [@bKumar](https://forums.percona.com/u/bKumar)\
**Post date:** [October 26, 2021, 6:38am UTC](https://forums.percona.com/t/mysql-5-7-replication-failure/12511/6 "2021-10-26T06:38:10Z")

</div>

Hi Matthewb,

No some of the tables are MyISAM and Memory tables were there.

Thanks  
Kumar

---

<div class="post-metadata">

**Author:** ![bKumar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/bkumar/32/8989_2.png) [@bKumar](https://forums.percona.com/u/bKumar)\
**Post date:** [October 26, 2021, 6:39am UTC](https://forums.percona.com/t/mysql-5-7-replication-failure/12511/7 "2021-10-26T06:39:39Z")

</div>

Hi zhouke,

Yes there were some myisam and memory tables, but duplicate issue came on innodb table

Thanks  
Kumar

---

<div class="post-metadata">

**Author:** ![zhouke](https://avatars.discourse-cdn.com/v4/letter/z/3bc359/32.png) [@zhouke](https://forums.percona.com/u/zhouke)\
**Post date:** [October 26, 2021, 6:49am UTC](https://forums.percona.com/t/mysql-5-7-replication-failure/12511/8 "2021-10-26T06:49:52Z")

</div>

> [@bKumar](#):
>
> I got an issue in mysql 5.7 master slave replication error.

Hi,bKumar  
at first, you can use Xtrabackup to resetup a slave instead of mysqldump .in fact I also believe that using mysqldump with all innnodb application tables to resetup a slave is feasible way.

---

<div class="post-metadata">

**Author:** ![Iori\_yagami](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/iori_yagami/32/6316_2.png) [@Iori\_yagami](https://forums.percona.com/u/Iori_yagami)\
**Post date:** [April 15, 2022, 5:11pm UTC](https://forums.percona.com/t/mysql-5-7-replication-failure/12511/9 "2022-04-15T17:11:26Z")

</div>

Hi, how are you?, Could you run pt-table-checksum to check the integrity of your databases?, If there Is unconsistency, you should run pt-sync to avoid these unconsistencies AND you make sure in the databases everything Is ok. Besides you could also check if there are autoincremental fields or not. Besides this theory Is related with the previous the triggers could be affecting also
