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 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.
How to quickly back up and restore a database with phpMyAdmin
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
Once you’ve selected the database, go to the main pane and select the Export tab [Figure B].
Figure B
In the next window [Figure C], make sure to select Quick, and SQL format.
Figure C
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
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
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