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.

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?

share|improve this question
    
if it is not possible to restore the data inserts, I'll be happy to recover at least the table structures. –  dole doug Apr 1 '11 at 20:15
add comment

2 Answers

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

share|improve this answer
    
ty for your replay. Unfortunately it restore just one table. It is true that I have some views there too. If I try to see the content of the view files, i can read the those queries, but i can't 'read' the queries of the tables. –  dole doug Apr 1 '11 at 20:13
    
did you ensure all the permissions are correct for all the directories/files. Reading the binary log isn't going to help you if you have a file-snapshot of the directory. –  Derek Downey Apr 1 '11 at 21:11
add comment

you can use mysql server without starting WAMP or XAMPP. you have mysql folder in WAMP right. so you can use Mysql database server without any issues.

just open command shell. Go to mysql/bin folder. start mysql server and use it

D:\WAMP\mysql\bin> mysqld --console


To take backup of your db open another command shell.

D:\WAMP\mysql\bin> mysqldump -uroot -pxxxxx databasename >D:\mysqldumps\bkpfilename.sql

then your database exported into bkpfilename.sql in D:\mysqldumps

if you want to create database in another mysql server using dump file

Start the server and open mysql client

opening a client

1) mysql\bin> mysql -uroot -pxxxx

2) mysql>create database databasename;

3) mysql>exit;

4) mysql\bin> mysql -uroot -pxxxx databasename

or

if file name or folder name contains spaces

** mysql\bin> mysql -uroot -pxxxx databasename<"D:\mysqldumps\bkpfilename.sql"**

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.