T
T
TANK_IST2013-12-15 23:07:31
MySQL
TANK_IST, 2013-12-15 23:07:31

Is it possible to restore databases with frm files?

I have three folders that were on the path /var/lib/mysql. Each folder contains files of the form table_name.frm and db.opt . I want to restore the databases now, but by simply dropping these folders to where they were before, only the databases themselves were restored, and inside they are empty, there are no tables, although they should be there. Is it possible to restore databases completely with table structures having these folders?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
Boris Syomov, 2013-12-16
@TANK_IST

Yes, you can restore the structure, but you need to parse these files - here is a description of their structure: dev.mysql.com/doc/internals/en/frm-file-format.html
Create code from them that creates the necessary tables, and in a fresh database it execute.

A
AntonDrelin, 2013-12-16
@AntonDrelin

No, the structure of the table itself is described in the .frm file, the data itself is stored in the ibdata file, if it was deleted or damaged, then goodbye data.

R
Roman Vasilenko, 2015-06-14
@farewell

You can restore as described here: www.msav.ru/blog/276-restore-a-mysql-database-from...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question