Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I accidentally dropped a MySQL database on my server. Are there any ways to recover a dropped database?

share|improve this question
    
What platform is your MySQL database running on? –  Jack Douglas Aug 28 '12 at 14:07
    
If it was running on a Windows box you might be able to use a simple file undelete utility to recover the deleted file(s). –  Max Vernon Aug 28 '12 at 14:10
    
Any chance the drive your database is on was being backed up and the server admin can save you? –  Kenneth Fisher May 29 '13 at 19:19
add comment

2 Answers

There's no easy way to break this to you. It doesn't matter if you dropped a db via phpmyadmin or the commandline. It is gone.

Human error is one reason to have a good backup regimen.

I'm not religious but I'll say a prayer hoping it wasn't anything too important.

share|improve this answer
    
it was very important, loads of transaction gonna lose –  kewl Aug 28 '12 at 7:15
6  
Best I could recommend in that case is unmount the filesystem your datadir was in. Shutdown the server if needed to do that. Call a data recovery service and be prepared to shell out thousands, if not tens of, all while paying for a crap shoot with no garauntees :-\ –  atxdba Aug 28 '12 at 7:21
    
If anyone in a similar situation reads this in the future, I think it's worth also suggesting that it's important to get the filesystem unmounted or read-only ASAP if you're going to hire a data recovery company. The longer writing continues on the filesystem, the more likely it is that the clusters containing your deleted files will get overwritten. –  James May 26 '13 at 17:10
add comment

Depends on your setup. It is possible to restore if you setup your system correctly. If you have a backup you can restore it. and then apply the binary logs up to the point just before you dropped the table.

http://dev.mysql.com/doc/refman/5.5/en/mysqlbinlog.html

I suggest you do this on another server, once you have the table restored you can use mysqldump to extract it and import back to your production server. This will not be a fast restore, but you can recover the data.

If you don't know what you are doing I would suggest openning a support contract with one of the mysql consulting companies (pythian, percona, palamino are probably the best) and have them help you with this.

I wish you the best of luck

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.