Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve a deleted database in PHPMyAdmin

I accidently deleted the whole database when I should just delete one table in PHPMyAdmin. Is there a way of retrieving the database?

like image 705
einstein Avatar asked Apr 09 '11 15:04

einstein


2 Answers

There are two ways:

  • Have a working backup of the system, and restore the files from it.
  • An undelete tool might help, if you deleted the db very recently (and ideally, if you unplugged the computer right afterward).

As for doing it with MySQL, though...on all systems i'm aware of, no. MySQL tables are files in the server's data directory, and dropping a table deletes those files. Once they're gone, they're gone, and only the methods above can get them back. A database is a directory of those files, and dropping it deletes the whole directory.

like image 194
cHao Avatar answered Sep 19 '22 11:09

cHao


Same thing here :-(
I closed xampp (V3.2.1) found the xampp\mysql\ folder, right-clicked and selected Restore previous version, select recent restore. When this finished I opened xampp and the missing database was back with the information dated as per the restore date. Not ideal but better than no database :-)

like image 22
user3297988 Avatar answered Sep 19 '22 11:09

user3297988