How to Backup Mysql Database?
You can easily back up a MySql Database. It is a very simple process. If you are familiar with the tools then it is quite easy for you to follow this tutorial. The basic idea behind backing up a mysql database is to create a copy of your existing database. But before that you need to identify your source server.
What Is Mysql
MySQL is a type of database management software which was designed for storing, manipulating, searching, and retrieving data. The first version of this product was released in 1995 by Monty Widenius, who later went on to found the company now known as MariaDB.
In short, MySQL is an open-source project which means that anyone can freely access all of the source code for it. This makes it possible to make changes to the way the software works, making sure that it always stays up to date.
How to execute MySQL backup?
Choose your mysql version and open your terminal (shell)
2. Type in the command (as root):
mysqldump -u root --password=PASSWORD db_name > /root/db_backup_file.sql
3. Save your mysql database in a special directory. For example /home/user/.mysql_dump
4. Create a crontab entry with the following content:
@reboot /bin/bash /root/script.sh
5. Run this script. It should be located in /root/.
6. Set permission to read and write only for owner and group.
7. Test if it works.