I got the following error from a MySQL query.
#126 - Incorrect key file for table
I have not even declared a key for this table, but I do have indices. Does anyone know what could be the problem?
I got the following error from a MySQL query.
#126 - Incorrect key file for table
I have not even declared a key for this table, but I do have indices. Does anyone know what could be the problem?
Error #126 usually occurs when you got a corrupt table. The best way to solve this is to perform repair. This article might help:
Try to run a repair command for each one of the tables involved in the query.
Use MySQL administrator, go to Catalog -> Select your Catalog -> Select a table -> Click the Maintenance button -> Repair -> Use FRM.
I got this message when writing to a table after reducing the ft_min_word_len (full text min word length). To solve it, re-create the index by repairing the table.
Came here searching for - "#1034 - Incorrect key file for table 'test'; try to repair it"
Seeing this caused by added a charset to an indexed Enum (might be the same with other fields) with Mysql 8.0.21.
CREATE TABLE `test` (
`enumVal` ENUM( 'val1' ) NOT NULL
) ENGINE = MYISAM;
ALTER TABLE `test` ADD INDEX ( `enumVal` );
ALTER TABLE `test` CHANGE `enumVal` `enumVal` ENUM( 'val1') CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
Solution using is to drop the index before the alter.
ALTER TABLE `test` ADD INDEX ( `enumVal` );