Here's a quick way to backup your Mysql database on your host and deliver it onto your local development environment. This is very useful for websites that use content management systems (CMS) where the data is generated on the hosting site and not locally.
Kobashi Computing cannot be responsible in the event of data loss. These instructions are informational purposes only. Use at your own risk.
Avoid Problems. Backup Regularly!
One good rule of thumb is to backup your website frequently just in case of emergency. Most shared hosting environments will backup on a daily basis, but only keep up to a one week snapshot of your website. If problems existed prior to that one week snapshot, it will be too late so best medicine is to do your own backups too regularly.
Cpanel and phpMyAdmin Backup
Go to your shared hosting environment and use PhpMyAdmin to save the database as a SQL text file. In this case, I am using Hostgator'scPanel environment.
Click on the phpMyAdmin icon:

Along the left hand side is a list of your databases. Choose the one you wish to backup. The screen will then switch to show you the database structure and operations you can take on it.
Click on the Export tab as we are going to save the database as a SQL text file:

Next, select all the items I have chosen in the screen shot and then click the Go button:

Now you should have a SQL text file saved as your backup. Store that in two places. Perhaps one copy on your local hard disk and another on an external backup drive/8GB flash drive/tape device.
Mysql GUI Tools
MySQL comes with some really useful utilities to make your life easier. One of them is the MySQL Query Browser that runs as a Microsoft Windows application. If you don't have it, download the Mysql Gui Tools.
If the database has not been created on your local system and assigned to a user, please do so. You can do this with MySql Administrator program by creating a new catalog schema. Make sure you create a new user and assign all rights to that catalog for that user.
Reinstate the database locally
Finally, launch MySQL Query Browser. Click the file menu and the choose Open Script option to load the SQL file we just saved. The script will load within a tabbed script window.

Click the Execute button to run the script and voila!
Use Hostgator
I strongly recommend as a shared hosting service Hostgator. This site happens to be on HostGator. I've used them throughout the years and they are extremely good on support and features.
If you sign up using Hostgator please use the banner above as we are a Hostgator affilliate. We use the ad revenue to run this website. And if you don't mind please contact me if you have done so. Thank you.
- SiteAdmin's blog
- Login or register to post comments

Del.icio.us
Digg
Technorati