Folks,
CRITICAL STUFF: as is often the case I've inherited a problem that was not mine to begin with.


Background: Debian Linux kernel 2.4.20, MySQL 4.0.13

1. I have a table that stores registration info for an uncoming importantn conference. Here's a description:
mysql> describe muggle;
+-------------+---------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+---------------------+------+-----+---------+----------------+
| REG_ID | int(5) unsigned | | PRI | NULL | auto_increment |
| FNAME | varchar(100) | | | 0 | |
| MI | char(2) | YES | | 0 | |
| LNAME | varchar(100) | | | 0 | |
| TITLE | varchar(10) | YES | | 0 | |
| AFFILIATION | varchar(100) | YES | | 0 | |
| ADDRESS | varchar(255) | | | 0 | |
| CITY | varchar(100) | | | 0 | |
| STATE | char(2) | | | 0 | |
| ZIP | varchar(10) | | | 0 | |
| COUNTRY | varchar(100) | | | 0 | |
| WORKNUM | varchar(100) | | | 0 | |
| FAXNUM | varchar(100) | YES | | 0 | |
| EMAIL | varchar(100) | | | 0 | |
| SPEAKER | char(1) | | | N | |
| POSTER | char(1) | | | N | |
| PT_TITLE | varchar(255) | YES | | 0 | |
| BANQUET | char(1) | | | N | |
| GUESTS | tinyint(2) unsigned | | | 0 | |
| STUDENT | char(1) | YES | | N | |
| NAMETAG | varchar(255) | YES | | 0 | |
| SUBMITTED | timestamp(14) | YES | | NULL | |
+-------------+---------------------+------+-----+---------+----------------+
22 rows in set (0.00 sec)


2. But alas the table is corrupted. A "select * from muggle" returns: "ERROR 1030: Got error 127 from table handler"
perror 127 says: "Error code 127: Unknown error 127 127 = Record-file is crashed"


But "select count(*) from muggle" and returns a count of 155.

3. I run multiple iterations of "myisamchk", shutting the daemon first:
--First:
myisamchk -e muggle.MYI
Checking MyISAM file: muggle.MYI
Data records:     155   Deleted blocks:       0
myisamchk: warning: 2 clients is using or hasn't closed the table properly
- check file-size
- check key delete-chain
- check record delete-chain
- check index reference
- check data record references index: 1
- check data record references index: 2
- check data record references index: 3
myisamchk: error: Key in wrong position at page 5120
- check records and index references
myisamchk: error: Record at:        268  Can't find key for index:  1
MyISAM-table 'muggle.MYI' is corrupted
Fix it using switch "-r" or "-o"

--Then some safer things: --quick --quick, then --set-auto-increment, then ultimately -o and -r.

--Using myisamchk -o and -r repairs the table but the last ~100 rows get deleted. Same thing if I use "repair table table_name" within the client. No good!

3. I restore the old tables. Shutdown the daemon and try to do a mysqldump -- vanilla, then with the --opt option. Here is what I get:

mysqldump -p database_name muggle > muggle.sql

mysqldump: Error 1030: Got error 127 from table handler when dumping table 'muggle' at row: 58

Wow this sucks. But I start to think.

4. Startup the daemon and launch client.
-I do "select * from muggle limit 0,58" and get everything!
-"select * from muggle" -- error 127
-"select * from muggle limit 60,61" --error 127
--Then I find there are 2 columns I'm able to get full data from (155 rows) -- LNAME and ATTRIBUTES.


I began doing things like trying to reindex or delete columns but to know avail (error 127). Strangly enough I'm able to insert new records into this mess??

Someone please provide some more hints:

How do I fix this table without losing ~100 records via myisamchk??
Is there a utility similiar to a hex editor that will allow me to hand edit the data files directly?


Thanks,

--
Robert Petkus
Unix Services
Brookhaven National Laboratory
[EMAIL PROTECTED]
631.344.3258
------------------
http://unix.bnl.gov



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



Reply via email to