Tutorial Thursday: Backing Up your mySQL Database

cPanel (most control panels actually) provides you with phpMyAdmin which is what we will use to backup our mySQL database.
Though you can backup your complete database at one go, I recommend making two backup files, one containing the Structure and the other containing the Data.
Why? Simply because your structure will usually remains same (unless you create / delete tables), while your data keeps changing.
By making a seperate file for Structure, you ensure that in the future only the Data needs to be backed up.
Here's how you go about it:
- Login to cPanel by going to yourdomain:2082
- Click mySQL Databases
- Click on Click here to access phpMyAdmin at the bottom of the page. A new window will open and load phpMyAdmin.
- If you have more than one database select the one you want to backup from the drop-down box in the left frame, or click on the name of the database if you have just one. A new page listing the tables will load in the right frame.
- Before we backup the database we shall optimize it. Click Check All and then from the drop-down box select Optimize Table.
- After the new page loads click on Export in the horizontal menu at the top.
- Now uncheck Data. Check Save as file. In File Name Template enter __DB___Structure. Select "gzipped" and then hit the Go button. You will be prompted to save a file. Save it. This file is your mySQL backup in gz format containing the Table Structure only
- Now check Data and uncheck Structure and change File Name Template to __DB___Data, while retaining all the other settings of step
- Click Go and save the file. This file is your mySQL backup in gz format containing the Table Data only.
In the future you can skip step 8 and only backup your Table Data.
Post Details
- Post Date :
- Thursday, Mar 8th, 2007 at 8:50 pm
- Category :
- Design and Development and Techtites Daily and Thursday and Tips and Tutorials
- Tags :
- Backup, cPanel, database, mysql, phpMyAdmin, tutorials
- Do More :
- Both comments and pings are currently closed.
4 Responses to “ Tutorial Thursday: Backing Up your mySQL Database ”
Comments:
Trackbacks & Pingbacks:
-
[...] How to backup your MySQL database: a simple tutorial to backup your MySQL databases, separating the structure from the actual data. [...]
-
[...] Check it here. Thanks [TechTites]. [...]
-
[...] Follow the instructions at Backup your WordPress Database and Backing up your WordPress site available in the codex or our tutorial. [...]






Some good tips, i actually had one of my sites content vanish becuase I never backed up.
Lesson learned!