I have dumped all my tables everyweek to got the backup. But later I understand that it is only storing the .frm file of the table. It is not showing .MYD and .MYI files of a table. So I have only my .frm file of the database with me and also mydatabase is innodb. So can I get my database with data in the database?
To open FRM file, we just need to double-click and let the software associated with it open it. Here the default software normally used is MySQL Database. MySQL Database is free to download and it supports multiple platforms.
Yes this is possible. It is not enough you just copy the .frm
files to the to the databse folder but you also need to copy the ib_logfiles
and ibdata
file into your data folder. I have just copy the .frm
files and copy those files and just restart the server and my database is restored.
After copying the above files execute the following command -
sudo chown -R mysql:mysql /var/lib/mysql
The above command will change the file owner under mysql and it's folder to MySql user. Which is important for mysql to read the .frm
and ibdata
files.
Just might be useful for someone:
I could only recover frm files after a disaster, at least I could get the table structure from FRM files by doing the following:
1- create some dummy tables with at least one column and SAME NAME with frm files in a new mysql database.
2-stop mysql service
3- copy and paste the old frm files to newly created table's frm files, it should ask you if you want to overwrite or not for each. replace all.
4-start mysql service, and you have your table structure...
regards. anybudy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With