It’s always a good idea to take frequent backups of your MySQL or MariaDB databases. They can potentially contain thousands of lines of irreplaceable data. Many users may be confused on how to back up their databases at first, as the process differs quite a bit from backing up ordinary files. The process of restoring a backup must also be known, as there’s no point in having a backup if the user cannot reliably restore it.
In this guide, we’ll go over various command line examples to back up and restore MySQL or MariaDB databases on a Linux system. You can then use these commands to make regular backups of your databases, or even add them to a Bash script that can do most of the work for you. Another option is to configure cron to make regularly scheduled backups of your databases.
In this tutorial you will learn:
- How to back up MySQL or MariaDB database (one or multiple)
- How to restore a MySQL or MariaDB database backup