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
please how to fix it?
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
please how to fix it?
Type
repair table 'table_name' use_frm
in SQL editor and execute it. This repairs the index. Good working...
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
Let me explain the details that I tried.
I got this "Incorrect file format" after performing the mysqldump. It's similar to like we have the issue in the server startup/querying the tables.
I went to the mysql/data/yourdatabasename folder and checked the table. (For MYISAM types of tables, we have .frm, .MYI, .MYD.) I found that the table has only tablename.frm only. So I just moved the frm part alone as it is not needed anymore because of the lack of .MYI and .MYD files. I did the same for some more tables that encountered with the incorrect file format problem.
In my case, tables that I removed are not MYI/MYD and some of the tables are not having data. Please make sure of both the cases before you do any of this. If you do for the data available table, you will end up with the data loss for the tables you remove.