Regardless of how big or small your website or organization is, the data on the website is an important aspect of running it. Losing data on websites can cost you a lot of money and time and should be prevented. Today Many websites have relied on online data backup for data protection to ensure that their valuable information is safe from theft, damage, or disaster impact.
By doing a database and file backup it can help restore your website more easily. Database backup is very important for protection against data loss which can completely disrupt a system or business on your website.
How to backup database :
To ensure that you can restore your website if something goes wrong, you should schedule automatic backups at regular intervals. Your MySQL database will usually be included in the backup (depending on your personal configuration). In this article I will tell you how to do a mysql dump or MySQL backup: First of all, we will go to MySQL server on Linux Ubuntu: Then write the following script, to run the MySQL backup command, notes:
Then write the following script, to run the MySQL backup command,
mysqldump -u root -p pass12345 exampledatabase > /home/exmpledb.sql
If your MySQL database has been successfully backed up it should appear in the /home/ folder.
How to restore database from backup
You have to login using the root user on your mysql server.
If the restore process is complete, it will appear like this.
If no errors appear during the restore process, then your database should be ready to be used again.