V
V
vlarkanov2017-09-02 08:45:32
MySQL
vlarkanov, 2017-09-02 08:45:32

How to make a consistent dump of an InnoDB + MyISAM database?

You need to dump the database to copy it to another server (where other databases are already spinning - this is important, because because of this I cannot use xtrabackup) and Master-Slave replication from the current server.
The database contains most of the tables on InnoDB and two on MyISAM, the base is about 6GB. The dump must be removed without stopping the operation of the application using the database. Is it suitable in this case?

mysqldump --single-transaction --master-data=2 DATABASE > database.sql

or in this case data inconsistency in MyISAM tables is possible? How to avoid it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Shatokhin, 2017-09-02
@vlarkanov

what would definitely be consistent is better to do something like this.
mysqldump --flush-privileges --flush-logs --triggers --routines --events --hex-blob --extended-insert --complete-insert --no-autocommit --lock-all-tables --master -data=2 DATABASE > database.sql
--single-transaction - Does not affect myisam. and it will be possible to write to it during the dump.
Such ladies are best done from a dedicated slave. Which will be completely locked for the duration of the dump. Well, or even with a pause in replication. If I were you, I would make such a backup slave using xtrabackup. And he did a dump of only the necessary bases from him.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question