|
Mar
13
|
Posted by admin
March 13, 2007 |
|
Every once in a blue moon (hopefully), you will need to restore a database. There are many reasons for this. Your database can become corrupted. You could have been hacked. There are all sorts of reasons. In any case, here is how you can quickly and easily restore your sql file.
Hopefully you have been backing up your database. This backup should be automated. I always preach that. If you don’t automate it, you will forget to do it - trust me. If you have a backup of your database, it will probably be in sql format. This makes restoring the database a snap if it’s under 2MB. Okay, log into your PhpMyAdmin. When this comes up, click on the Sql icon located here:

When you click on this it will pop open a window. This has an Import Files tab. Click on that and you will be able to browse and upload your sql file.

Now, you may get errors if you exported or backed up the database data and the structure. Unless you dropped all the tables in the database before you tried to restore them here, you will get errors. That’s because the database already has tables with those names. And your sql file is trying to recreate them. All you have to do in this case is drop the tables and then reimport the sql file again. Make sure you have a good backup before you do this because you are effectively destroying your database!
Comments