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 existsKeepold
: 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 --keepold
mysqlhotcopy
locks tables while performing backups and then unlocks them once done. It doesn't back up in the SQL format, rather it backs up files. If you have a huge amount of data, even though if it's faster than mysqldump
...