How to restore deleted database in phpmyadmin

I accidentally dropped my MySQL database in PhpMyAdmin, is there a possibility to recover my database?

asked Dec 9, 2009 at 15:28

3

Sure. You can restore it from your backup.

Otherwise, you're out of luck, unless your ISP has a backup that can restore it. You'll need to talk to them about that, though... They may charge you for doing so.

answered Dec 9, 2009 at 15:30

Ken WhiteKen White

1911 silver badge5 bronze badges

I just accidentally dropped my database on my local wamp server. It was lost and I felt all hope was gone, but immediately I searched on the internet to find solution, but I did not get. However, I recovered it and here is how I did it. I went to the folder where phpmyadmin stores the raw data of my databases in my case "C:\wamp\bin\mysql\mysql5.1.32\data" then I noticed that the folder for my dropped database was not there, which means it is gone forever [not really]. What I did next was to right-click inside the "data" folder window and I selected "properties" and clicked the "Previous Versions" tab. In that tab there was a list of previous versions with dates, so I selected the one I wanted, in my case I selected the previous version of the "data" folder which was 2 hours earlier. then I clicked "Restore" then it restored back the folder. During the process you might get a pop-up that says restore can not complete as the folder is used by another process, don't worry, just go and stop the local server service and click "try again". I hope this helps someone. then copy and paste the folder to the data directory and that is it

answered Jul 20, 2011 at 8:34

MarkMark

591 silver badge1 bronze badge

3

If you have a backup of the DB, or if your PC / Server has some kind of file system snapshot like DFS or Volume Shadow Copy [found in Vista], then yes there is some hope.

Otherwise, nope. Your DB is gone.

answered Dec 9, 2009 at 15:30

1

nope, when drop at table, you drop it from a 10 miles high cliff.

I hope for you you've made a back-up or make use of an other back-up solution that automatic backs it up every day or so.

answered Dec 9, 2009 at 15:34

Short answer: no.

answered Dec 9, 2009 at 15:30

motemote

1114 bronze badges

on December 21, 2021, 9:20 AM PST

How to quickly back up and restore a database with phpMyAdmin

If a web-based GUI is better suited to your admin skills, Jack Wallen wants to show you how to back up and restore your MySQL/MariaDB databases with one of the easiest tools on the market.

Many of your business processes depend on databases. Should one of those databases fail, your workflow could come to a standstill. That would cost you money, an outcome you certainly do not want.

To avoid that, you need to back up those databases. I’ve already walked you through the process of doing so from the command line. This is most definitely a technique you should know. But there might be times when you want to work with a bit more efficiency, such as by way of a web-based GUI like phpMyAdmin. That, my friends, is exactly what I’m going to show you today.

After you read how easy this is, you might never go back to the terminal for this task.

Let’s get to work.

SEE: 40+ open source and Linux terms you need to know [TechRepublic Premium]

What you’ll need

You’ll need three things to make this happen:

  • A running instance of phpMyAdmin
  • A user with full access to the databases [such as the phpmyadmin user]
  • A database to back up

With those things at the ready, let’s back up and restore that data.

How to back up a database with phpMyAdmin

The first thing we’ll do is back up the database. Log in to phpMyAdmin and select the database to be backed up from the left navigation [Figure A].

Figure A

I’m going to back up my nextcloud database.

Once you’ve selected the database, go to the main pane and select the Export tab [Figure B].

Figure B

The export tab is where the backup process is found.

In the next window [Figure C], make sure to select Quick, and SQL format.

Figure C

You can ignore the export template window for basic backups.

Click Go and you’ll be prompted to save the .sql file from the export. Save the file and the backup is complete.

One thing to keep in mind is that phpMyAdmin can’t regularly back up your databases. Because of this, you must manually back them up. I’d suggest getting in the habit of doing this daily.

How to restore from a backup

Should something go wrong with your database [let’s hope it never does], you can restore it from your latest backup but it’s not quite as straightforward as is the backup.

First off, you have to delete the failed backup From phpMyAdmin. To do that, click on the SQL tab and, in the query pane [Figure D — the text area above the Submit Query button] type:

drop database NAME;

Where NAME is the name of the database to be deleted.

Once you’ve done that, you then need to create a new database with the same name. Go to the main phpMyAdmin window and go to the Databases tab. Type the name of the new database and click Create [Figure D].

Figure D

Recreating the deleted database.

Once the database has been created, select it from the left navigation and click the Import tab. In this new window [Figure E], click the Browse button and then locate the .sql backup file you downloaded from the export.

Figure E

Restoring a MySQL database using the phpMyAdmin import tool.

This action will take some time [depending on how large the database is]. When the import completes, you should see all of the tables listed in the left navigation and you’re good to go. Although this process isn’t quite as simple as when working from the command line, it will get the job done and do so with the help of a handy GUI.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.


Image: iStock/gorodenkoff

Also See

  • How to become a developer: A cheat sheet [TechRepublic]
  • How-to guide for Linux administrators [free PDF] [TechRepublic]
  • Linux 101: What tech pros need to know [TechRepublic Premium]
  • Linux, Android, and more open source tech coverage [TechRepublic on Flipboard]

  • Networking
  • Open source

How do I restore a database in phpMyAdmin?

Restore your MySQL database from a phpMyAdmin Backup.
Log into your cPanel account..
Now, from the left navigation tree, select the database[s] that you want to backup..
Click the Check All option..
From the drop-down menu, click on Drop..
Click Yes to give confirmation..
Now, click on the Import tab..

How do I recover a deleted database?

To recover a deleted database to the deletion time by using the Azure portal, open the server's overview page and select Deleted databases. Select a deleted database that you want to restore, and then enter the name for the new database that will be created with data restored from the backup.

How do I restore a deleted MySQL database?

Recovering a Lost or Deleted MySQL Database.
Run Hetman Partition Recovery and scan the disk where a MySQL database was stored..
Using the program, go to the folder C:\ProgramData\MySQL\MySQL Server 5.7\Data, ... .
Recover database files..
Bring them to the folder with the name of the database..

How do I backup and restore a database in phpMyAdmin?

How to Backup and or Restore your MySQL Database Using phpMyAdmin.
On the Home screen, scroll down to Databases and click on phpMyAdmin..
Select the database you would like to backup from the left navigation tree..
Click the Export tab..
Choose the Quick export method and click Go..

Chủ Đề