Custom Search

You are hereBlog / site back up: restored MySQL table via phpMyAdmin

site back up: restored MySQL table via phpMyAdmin


Posted on November 05, 2008 by Denis

Printer-friendly versionSend to friend

The site was down this past week due to me accidentally deleting a crucial Drupal table in the database when attempting to implement some tweaks. Thanks to Hostmonster's automatic database backup feature (sitewide file and SQL database backups are performed once per week), I was able to restore the table I needed.

And for the record, here is how I inserted only one table from the entire Drupal SQL file via phpMyAdmin. This comes in handy when you only want to insert one table (or selected tables) into an existing database from a SQL backup file with multiple tables as phpMyAdmin does not have table-specific import support yet (all tables from a SQL file must be imported at once):

  1. Create a new, blank MySQL database (I used Hostmonster's cPanel database creation wizard).
  2. Open phpMyAdmin and select this new database from the left menu.
  3. Select the "Import" tab and import the backup SQL file.
  4. Select the "Export" tab and only select the table you want to export. Check "Save as file." There's no need to modify the other options.
  5. Go back to phpMyAdmin root (or "localhost") by clicking on the phpMyAdmin logo and open the MySQL database of interest.
  6. Select the "Import" tab and import the newly created SQL file with the selected tables that you have exported previously.
  7. Done!

This may be some sort of a workaround as but it works and prevents tables you don't want to be overwritten to be intact.

Anonymous's picture

hi all, i played with mysql db management tool. then look what i have found sqlyog. It has become part of my life where it has made my job easy. simply rocks!!!

recent comments

Anonymous's picture

It is better to take sure shot stock tips or advices from someone before investing in Stocks and Commodities market instead of losing money and then regretting.
We at Capitalstars Financial Research Pvt. Ltd. Do this for you and help you make profit in stocks and commodities market. Our technical analysis team is an experienced one and provides sure shot stock recommendation with 90-95% accuracy rate. Avail our free trial service to know more.
Stock Tips

Anonymous's picture

It is better to take sure shot stock tips or advices from someone before investing in Stocks and Commodities market instead of losing money and then regretting.
We at Capitalstars Financial Research Pvt. Ltd. Do this for you and help you make profit in stocks and commodities market. Our technical analysis team is an experienced one and provides sure shot stock recommendation with 90-95% accuracy rate. Avail our free trial service to know more.

Anonymous's picture

Hi ,

I must say thanks for sharing your blogs and articles ,they all are very useful for me.

thanks metrogyl
http://supernsetips.com

Foxkeh

View Denis Lam's profile on LinkedIn