If you have a MySQL database working behind the scenes on your web site or app then creating and storing backup’s of that database can be vitally important to the operation of your business operations. A MySQL or MariaDB database uses the
mysqldump command to create backups.
mysqldumpcommand outputs a file that contains SQL statements that can be used to rebuild your database, with all of its data. Which could come in handy in the event of an unrecoverable crash or even to just move the database to a new server.
Following the steps in this guide should work on any distribution of Linux that is using MySQL or MariaDB.
- Review the command
- Convert to script
- Run as nightly cron job
- Restore database