MySQL Forums
Forum List  »  Replication

Getting consistent backup of slave that has foreign keys
Posted by: Alexander Spitzer
Date: February 29, 2016 07:33AM

I have a slave DB that is just for backups.
I backup the DB with the following commands:

1) I "stop slave"
2) I "show slave status" to get the positions of replication
3) mysqldump -R -u root -p'xxxx' --single-transaction mydb > mydb.sql
4) I "start slave"

When setting up a new slave, the import works fine (no FK errors), but when I start replication on the new slave, I get FK errors pretty quickly. (the server-id are unique if you were wondering).

I don't see how this is possible, since I stopped the slave (so there are no db changes during the dump), and no one is using the db.

What am I doing something wrong?

We have mysql 5.1 (which we are working on upgrading) on Centos 5.x.

It is also not a FK import issue, since the db imports fine and the dumps have this in the beginning and end of the datafiles:

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;

Thanks!

Options: ReplyQuote


Subject
Views
Written By
Posted
Getting consistent backup of slave that has foreign keys
1843
February 29, 2016 07:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.