How to restore my MYI, MYD tables from .FRM

Possible duplicate:
How to recover mysql db from .myd, .myi, .frm files

I saw this question here, but to be honest, I can not understand any of the solutions published. I just reinstalled Windows Vista after some problems, and I made a copy of the entire "data" folder for the old Mysql installation. The original and recently installed version of MySQL was 5.0.85.

The original version of phpMyAdmin was 3.2.1, but now I have the latest version installed: 3.5.3. The problem is that I lost some MYI and MYD files, which I believe are tables and index files. All .FRM files are present and the ibdata1 file (also ib_logfile0 and ib_logfile2).

Tables are displayed in phpMyAdmin on some screens, such as the "Assign table privilege levels" drop-down menu, so they seem to be still there, but they do not appear in the left column, which shows all the tables in aDB. Are they restored or lost forever? I would appreciate any help in sufficient detail to understand for beginners. I installed WAMP before but have never encountered this problem.

gratefully in advance ...

+4
source share
1 answer

.frm files contain metadata about the structure of the table. They do not contain your data.

For a MyISAM table, the .MYD is basically a table (without metadata or indexes); if he left, your data disappeared. There is probably a way to create “empty” files and start over, but yes. Without them, you have no data.

.MYI files contain AFAIK indexes. They can be restored, but not without data.

If your tables were InnoDB tables, you might be in luck. For InnoDB tables there will be no .MYD or .MYI ; the data that would be in them will be in ibdata1 . You could (after stopping mysqld) simply sneak the .frm and ib* files to the correct positions and let mysqld see them when you restart.

Of course, this will not work if you already have InnoDB data files - more precisely, if this happens, you will lose all existing InnoDB tables. In this case, you can put the files in another directory and run the mysqld instance pointing to that directory. This would be enough for a mysqldump table like SQL, so you can import it into a new database.

+7
source

Source: https://habr.com/ru/post/1445652/


All Articles