Using mysqlhotcopy

mysqlhotcopy is a little bit less known; however, it is faster than mysqldump and is available with standard MariaDB. The limitation of this tool is that it only works for MyISAM and Archive tables.

To back up locally, use the following command:

> mysqlhotcopy user password /var/lib/mysql/my_database --allowold –keepold

Here is the explanation of the options:

  • allowold: This will rename a backup directory as _old if the already exists
  • Keepold: This prevents the previous backup from getting removed
  • /var/lib/mysql/my_database: This sets the path to your production database

If you want to send the backup to a distant server, use the following command:

> mysqlhotcopy --user=user --password=pass user user@host:/home/mon_backup --allowold ...

Get MariaDB High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.