Fast MySQL Backup and Restore Using Mydumper and Myloader
wplobster.com
wplobster.com
The article also does not link to the official maintainer page/github page.
I should note that the version of `mydumper` in the Ubuntu repos is out of date. IIRC 0.9.1 is the latest and Ubuntu packages 0.6.1 on the latest LTS. 0.9.1 has some good improvements so it's worth building yourself (small utility so quick build time).
As always with database stuff, RTFM and use an abundance of caution. In particular, take care to ensure no bad locking behaviors occur.
Ever since I started using mysql replication I've been mostly relying on replicated incremental backups with xtrabackup.
To workaround the downside of not being able to restore a single table I'm using some scripts I found online that perform automatic restore tests of the xtrabackup backups with docker. That way I can access the restored DB in the docker container and export/dump whatever I want.
This also enables me to run a restore test and data integrity test on the restored data every day and report the status to my monitoring platform.
2. Segfaults for me
I'll be using mysqldump for now...but doing a flush+lock+copy the innodbdata file(s) seems like it would be much, much faster.
There's also other things to potentially worry about; events, functions, etc.
I'm probably too dumb to find it, but I have found no utility to export/import db users and grants. Not that it's hard to roll your own thou.
[1] https://www.percona.com/blog/2015/11/12/logical-mysql-backup...
As a logical backup tool, it's invaluable. When combined with binary logs and regular binary backups, it makes for a nice and comprehensive MySQL backup solution. It even works with managed DB services like RDS.
YMMV of course, but given how easy it is to test for your own use cases, it's absolutely worth taking a look at.
I haven't test it yet because mysqldump is enough for our needs.
- it will create broken backups for databases with triggers; the bug has been open for more than an year;
- it breaks compatibility with the `mysqldump` output format, since it adds the database name to the table names (without the option to avoid this);
- it has an unclear product placement: it's not a subset of mysqldump (it has functionalities added), but it's not a superset either (it has functionalities missing).
The status of the mysql dump/restore tools is, in general, very underwhelming.The Percona mysqldump version adds a switch for improving innodb indexes re-creation on restore (by moving the ADD KEY after the records insertion), but it's never been merged upstream.
Also, the pattern table matches is extremely useful for cases where it's required, but it's not clear why they added it to mysqlpump rather than to mysqldump.
Mysqlimport has a limitation (bug?) which prevents tables with mixed UTF-8 data and JSON columns to be imported (!!).