HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Restore MySQL DB from its folder

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
mysqlitsfolderfromrestore

Problem

Some time ago, I've built an webapp on top of WAMP server. At that time, I didn't do any export/dump of my MySQL DB but I've did a copy of the WAMP folder. Does anyone have any ideas about how I can restore my DB from the 'mysql' folder of WAMP?

I have the .frm files and lots of mysql-bin. files

Do you have any advice for me?

Solution

Assuming default data directory setup (no partitioning etc), you follow these steps:

1) Stop the mysql server
2) Make a backup of the current mysql/data directory
3) Copy all the files and folders from the mysql/data backup directory into the active data directory
4) Restart mysql


This should let you restore the database to the point-in-time of your backup copy. The mysql-bin files aren't necessary for a recovery, but ibdata* files are (assuming innodb tables). If myisam, you should have .MYI and MYD files for each tablespace as well as the .frm files.

Hope this helps

Code Snippets

1) Stop the mysql server
2) Make a backup of the current mysql/data directory
3) Copy all the files and folders from the mysql/data backup directory into the active data directory
4) Restart mysql

Context

StackExchange Database Administrators Q#2026, answer score: 6

Revisions (0)

No revisions yet.