Restore deleted database
I just deleted two days of work because I though I had a backup, but I didn't. Now I need to create the database from scratch and I just wonder, isn't there a开发者_C百科 built-in backup system, just in case of someone being stupid? It's running on localhost and I haven't exported it out before.
If you've had binary logging enabled, then you might be lucky enough to use it to restore your database.
Note: If you ask me 'how do I know if I had binary logging enabled?' this pretty much means you didn't, because it's disabled by default.
There are several options. They're covered in detail at http://dev.mysql.com/doc/refman/5.1/en/backup-and-recovery.html
If you are developing some kind of app, I'd also recommend to store your DB structure in your version control system together with your source code.
No.
Computers will do anything you command them to - but it is your responsibility to know what you're doing.
In this way, "if you wanted backups, you would have made them" - power-user tools (such as databases) are optimized for performance, not for being user-proof.
Install the MySQL Workbench:-
- On left side panel (i.e. under the Administration section), you will find the option to "Data Import/Restore".
- On click, you will land on the Data Import. Select the option "Import from Dump Project Folder" and then select the file based on TimeStamp of that duration when the database was deleted.
- Click on "Load Folder Content"
- Select database object to import, check whether the deleted database is visible or not.
If visible then select all the tables and click on start import button.
If not visible then start with step 2 again and one by one select all the dump files.
At least I was able to recover all my database which accidentally got deleted during the database restore (i.e. initialization process). This has saved my weeks of effort.
精彩评论