How To Backup a MySql Database
Since alot of people are unsure on how to make a backup of their MySql database, i thought i would put this quick and easy tutorial on how to make a backup.
This article focuses on using cPanel and PhpMyAdmin which is the most common environment people have on their shared hosting accounts. I've also taken screenshots making things very simple to follow. Making a backup of your MySql database is very important, and making regular backups is something every webmaster should do to prevent data loss in case something unexpectant happens.
Step 1: Log in to cPanel
Log in to your cPanel by going to yourdomain.com/cpanel
From the main page, click on the MySql databases button.
Step 2: Enter phpMyAdmin
Scroll to the very bottom of the page, from there you will see a plain text link as seen in the following image. Click this to enter phpMyAdmin.
Step 3: Select Your Database
Now your in phpMyAdmin. Over on the left you will see a drop down list containing your databases on your cPanel account. Click this drop down and select your database you want to backup. In this case i'm choosing vb (as i'm due for a backup)
Step 4: Select All Tables
After you choose your database from the drop down menu, phpMyAdmin will load that database and show you a page of all the tables contained in it. Simply scroll to the bottom of the page and you will see a plain text link with "Select All" as illustrated in the picture.
Click this and phpMyAdmin will highlight all the database tables.
Step 5: Exporting The Database
Once you click the "Select All" scroll back to the top of the screen. From the top menu, click the "Export" tab highlighted in the picture.
Step 6: Export Options
Once you click the Export tab, phpMyAdmin will take you to a page with a number of Export options. You will see a white export box with your database tables listed, under this there's another "Select All" link as seen in the picture. Click this, and all your tables will be highlighted.
Step 7: Selecting backup type
Once you click the "Select All" box, scroll to the bottom of the screen. Tick the "Save As File" check box as seen in the following picture. Now lastly (phew) all you need to do is select what file type you wish to save your database as. Choosing "none" will save it as a .sql text file, it's not really a good idea for large databases.
You can also choose Zipped or Gzipped formats. I always choose the Gzipped option, as this compresses the database to it's smallest size.
Conclusion:
Hopefully this small tutorial is simple to follow (we all like pictures) and you managed to Export a backup of your database successfully. It's really not that hard, and after you have done this a few times you will be backing up your database like a pro without needing to look up this guide.
The frequency of your backups depends on how much new info is placed in to the database on a daily basis, and how important this information is. I backup Tareeinternet weekly, as i only put up a couple of tutorials every week so weekly suffices in this situation, however on an article website i own i back-up the database daily due to the large volume of new material submitted daily.
Also look out for my next one, Importing Your Database from a Backup.