Friday, October 4, 2013

Mysql Physical Backup

Ever looked in Mysql installation directory ? I recently did.(E:\wamp\bin\mysql\mysql5.5.24\)
found various strange files which can be used as Mysql DB physical backup if you dont have time to run the mysql server and then run mysql dump for all databases.



So what files are of our interest ?
 Base folder-> E:\wamp\bin\mysql\mysql5.5.24\
1. Lets say you have database name test. You can find a directory named test under data folder. In test you can find .FRM, .MYD , .MYI, .TRG, .TRN files for most of the tables. Take backup of all of these files.
2. You will also find ib_logfile0, ib_logfile1, ibdata1 in base folder. For few tables data is stored in these files as well.

Take above mentioned file backup and put in new mysql installation directory and you are good to go.
As written. here -
http://kedar.nitty-witty.com/blog/mysql-related-file-types-and-basic-information

.frm is for table definition
.myd is for table data
.myi is for table indices
.trg, .trn for trigger definitions

Happy backing up :)

No comments:

Post a Comment