Hello all,
I am getting quite desperate on this, since I've been trying to recover my diary of a whole year of travelling which was stored in a MyISAM table for a couples of weeks now! The MySQL server was running in a XP machine and suddenly the hard disk crashed starting my particular nightmare. I had to use recovery tools to scan the disk and I thought I was saved when I found the *.frm, *.MYI and *.MYD files and was able to recover them, but when I tried get the tables back into MySQL and backup their contents, I found a series of errors that have kept me down ever since!
The first complain I got when I selected the table was:


Didn't find any fields in table 'news'

I then checked the table for errors, and got:

mysql> check table news;
+----------+-------+---------- +-------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+----------+-------+---------- +-------------------------------------------------+
| ver.news | check | error | Incorrect information in file: './ver/news.frm' |
+----------+-------+---------- +-------------------------------------------------+
1 row in set (0.03 sec)


I checked it with myisamchk and got:

Curro:/usr/local/mysql/bin root# ./myisamchk ../data/ver/news
myisamchk: error: '../data/ver/news' is not a MyISAM-table

I was reading the manual and since I had the description of the original tables, I created new tables with the same structure and used the *.frm files. With myisamchk I got the same error, but with CHECK TABLE the error changed and got:

mysql> check table news;
+----------+-------+---------- +------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+----------+-------+---------- +------------------------------------------+
| ver.news | check | error | Can't open file: 'news.MYI' (errno: 130) |
+----------+-------+---------- +------------------------------------------+
1 row in set (0.01 sec)


Which meant I guess, the file is corrupted:
MySQL error:  130 = Incorrect file format

I then used the new *.MYI and got the following errors:

Curro:/usr/local/mysql/bin root# ./myisamchk ../data/ver/news
Checking MyISAM file: ../data/ver/news
Data records:       0   Deleted blocks:       0
- check file-size
myisamchk: warning: Size of datafile is: 848484          Should be: 0
- check record delete-chain
- check key delete-chain
- check index reference
- check data record references index: 1
- check record links
myisamchk: error: Wrong bytesec: 154-126-101 at linkstart: 0
MyISAM-table '../data/ver/news' is corrupted
Fix it using switch "-r" or "-o"

mysql> check table news;
+----------+-------+---------- +------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+----------+-------+---------- +------------------------------------------------+
| ver.news | check | warning | Size of datafile is: 848484 Should be: 0 |
| ver.news | check | error | Wrong bytesec: 154-126-101 at linkstart: 0 |
| ver.news | check | error | Corrupt |
+----------+-------+---------- +------------------------------------------------+
3 rows in set (0.10 sec)


I searched the web to try to find a fix but I couldn't find any solved problem similar to this, with the Wrong bytesec at linkstart 0.
I tried to repair the tables, and both the REPAIR TABLE and the myisamchk repairs using the newly created .frm and .MYI files resulted in an empty set, a truncated data file. I also tried with REPAIR TABLE .. USE_FRM with no luck, always complaining first of the 'Wrong bytesec' and then finding the blocks either that point outside data file or too small. Here is an extract of the result:


mysql> repair table news USE_FRM;
+----------+--------+---------- +----------------------------------------------------------------------- -------+
| Table | Op | Msg_type | Msg_text |
+----------+--------+---------- +----------------------------------------------------------------------- -------+
| ver.news | repair | info | Wrong bytesec: 154-126-101 at 0; Skipped |
| ver.news | repair | info | Found block that points outside data file at 488 |
| ver.news | repair | info | Found block that points outside data file at 544 |
| ver.news | repair | info | Found block with too small length at 896; Skipped |
| ver.news | repair | info | Found block with too small length at 1120; Skipped |
| ver.news | repair | info | Found link that points at -4170694140902777944 (outside data file) at 1148 |
| ver.news | repair | info | Found block that points outside data file at 1232 |
| ver.news | repair | info | Found block that points outside data file at 1716 |
| ver.news | repair | info | Found block that points outside data file at 1944 |
| ver.news | repair | info | Found block with too small length at 2044; Skipped |
| ver.news | repair | info | Found block with too small length at 2068; Skipped |
.
.
.
| ver.news | repair | info | Found block that points outside data file at 847492 |
| ver.news | repair | info | Found block with too small length at 847928; Skipped |
| ver.news | repair | info | Found block that points outside data file at 848044 |
| ver.news | repair | info | Found block that points outside data file at 848364 |
| ver.news | repair | status | OK |
+----------+--------+---------- +----------------------------------------------------------------------- -------+
3224 rows in set (1.50 sec)


Please note that the different methods I used (REPAIR TABLE, myisamchk) all resulted as status OK, but the data is truncated.
The tables were generated with MySQL version 3.23.58 under XP, and tried to fix them with the same version, with version 4.1.10 under XP and version 4.1.8 under Mac OSX.


Could somebody please help me! I am getting quite desperate on this, I've tried to recover the files with 5 different programs and all recover the same files, so I think the .MYD file should not be corrupted...
Please advice what could I do next, I'm out of ideas!


Thank you very much for your help.
Fran.


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to