I have the mysql
table called Sample. I have edited the file /var/lib/mysql/Sample.MYI
with some values. Now check TABLE Sample query shows as
Incorrect key file for table 'Sample'; try to repair it
To repair this, i have tried using the following command myisamchk -r Sample.MYI
. but the result is "myisamchk:
error: Got error 140 when trying to recreate indexfile MyISAM-table
Sample.MYI
is not fixed because of errors".
Now how to repair this table ?
Just in case you don't have backup, don't have the original file and cannot redownload it, here are some links that might help you:
http://www.felipecruz.com/repair-mysql-database.php
http://dev.mysql.com/doc/refman/5.0/en/myisam-repair.html (see also links at the bottom of this page)
http://forums.mysql.com/read.php?21,362974,362974
The following command will recreate .myi files from scratch:
REPAIR TABLE tablename USE_FRM
Be careful with this though, this page: http://dev.mysql.com/doc/refman/5.5/en/repair-table.html says:
Use the USE_FRM option only if you cannot use regular REPAIR modes! Telling the server to ignore the .MYI file makes important table metadata stored in the .MYI unavailable to the repair process, which can have deleterious consequences:[.....]
And finally how to redo this in different ways:
http://www-users.cs.york.ac.uk/susan/joke/foot.htm
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