How to handle "Incorrect key file for table" in mysql

Source: Internet
Author: User

Recently, server problems have caused the company to lose a lot of website data. Smart softwares also lost a lot. I have been busy fixing data over the past few days.

When we restore a customer's data today. A consistent problem was found. Multiple tables are damaged. Because the tables are copied directly. Then this problem occurs.

Dedecms Error Warnin!
Error infos: Incorrect key file for table 'it _ member_snsmsg '; try to repair it


Image 1
 

This means that the table is broken ..

The solution is as follows:

The specific operation method is as follows:

Directly enter

Copy codeThe Code is as follows:
Repair table tablename;
Repair table tablename USE_FRM

Replace tablename with the table name! However, if the data is fixed, it will be lost. You can only import the data.

If you operate on the server, you can use Navicat Lite for MySQL or use batch processing.

Copy codeThe Code is as follows:
Cmd/k myisamchk -- recover dede_archives

Solution to the mysql error on the linux Server:

Mysql> select * from Filter limit 4;
ERROR 1034 (HY000): Incorrect key file for table 'filter'; try to repair it

After the repair table is repaired, it is still useless:
Mysql> repair table Filter;
+ ----- + --- + ---- + ------------------- +
| Table | Op | Msg_type | Msg_text |
+ ----- + --- + ---- + ------------------- +
| Pfsmtp. Filter | repair | Error | Incorrect key file for table 'filter'; try to repair it |
| Pfsmtp. Filter | repair | error | upt |

Exit mysql and perform the following repair actions:
Myisamchk-of/mail/var/mysql/smtp/Filter. MYI
Myisamchk-r/mail/var/mysql/smtp/Filter. MYI
Myisamchk safe-recover/mail/var/mysql/smtp/Filter. MYI

Restart mysql and then fix the problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.