In most content management and ecommerce systems the majority of the sites data is stored in a database. MySQL is the most commonly used database platform for websites and is the subject for this tutorial. To complete this tutorial you will need two things:
If you do not have your database connection details you can get them from your hosting providers technical support.
If you do not already have a copy of SQLYog you can get it from the address below for free:
Once you have installed SQLYog run the program from the desktop shortcut. This is the first window you will see:
If you are having trouble with this tutorial it may be because you're database is not configured to allow remote connection. Below are instructions on how to correct this problem using your cPanel hosting administration area. You should have been provided details on how to access your cPanel by email when you first setup your hosting. Find this email and follow the instruction in it. If you cannot find it contact your hosting provider and ask for the email again. Once you have logged in to your cPanel follow the instructions below:
Now that you have connected to the database we can begin taking a backup. You should now see a screen that has a one area on the left of the window listing out the available databases. If there is more than one database listed here find the name of the database you wish to backup and ight click on it. This will cause a menu to appear. Find the menu option labelled 'Backup Database as SQL dump ...' and click it. This will cause a window like the one below to appear:
It is important to take regular backups of the databases that support your business sites. If they are lost all of the content you have written for your site, your order histories and customer information are lost in them.
To restore your database first connect to your MySQL server using the instructions from the first part of this guide. When you have connected go to the DB menu near the center top of the window then click on 'Restore from SQL dump ...' and a window like the one below will appear:
Click the '...' button and an open file dialogue will appear. Find the database backup we created in the previous stage and open it. If you have several backups of the same database find the one with the latest date.
Once you have opened the correct database file click 'Execute'. This will recreate your database in the exact state it was in when you backed it up.
Only attempt a database restore if your current database is completely unrecoverable. This is a potentially damaging procedure and if you are at all unsure seek professional help.
If you prefer an easier route to the one laid out in the article above we offer a fully automated database backup service called AutoDB. All you have to do is sign up to our service at the link below and provide us your database connection details. We will configure our servers to take a complete backup of your mysql database every 24 hours. If you ever have a database failure in the future all you have to do is call our hotline any time 24 hours a day 7 days a week and we will immediately start restoring your database. Typically this means your site can be back online in under an hour.