How to fix “ERROR 130 (HY000): Incorrect file format”

前端 未结 3 970
甜味超标
甜味超标 2020-12-11 02:04

I have a problem with my database when I made a query on one of my tables I get this error message

ERROR 130 (HY000): Incorrect file format

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-11 02:18

    try repair table , another good article


    The relevant section from the first link:

    MySQL database allows you to define a different MySQL storage engine for different tables. The storage engine is the engine used to store and retrieve data. Most popular storage engines are MyISAM and InnoDB.

    MyISAM tables -will- get corrupted eventually. This is a fact of life.

    Luckily, in most cases, MyISAM table corruption is easy to fix.

    To fix a single table, connect to your MySQL database and issue a:

    repair TABLENAME
    

    To fix everything, go with:

    /usr/local/mysql/bin/mysqlcheck --all-databases -uUSERNAME -pPASSWORD -r
    

    A lot of times, MyISAM tables will get corrupt and you won't even know about it unless you review the log files.

    I highly suggest you add this line to your /etc/my.cnf config file. It will automatically fix MyISAM tables as soon as they become corrupt:

    [mysqld] 
    myisam-recover=backup,force
    

    http://www.softwareprojects.com/resources/programming/t-how-to-fix-mysql-database-myisam-innodb-1634.html

提交回复
热议问题