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 i
Now of the other answers solved it for me. Turns out that renaming a column and an index in the same query caused the error.
Not working:
-- rename column and rename index
ALTER TABLE `client_types`
CHANGE `template_path` `path` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
DROP INDEX client_types_template_path_unique,
ADD UNIQUE INDEX `client_types_path_unique` (`path` ASC);
Works (2 statements):
-- rename column
ALTER TABLE `client_types`
CHANGE `template_path` `path` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
-- rename index
ALTER TABLE `client_types`
DROP INDEX client_types_template_path_unique,
ADD UNIQUE INDEX `client_types_path_unique` (`path` ASC);
This was on MariaDB 10.0.20. There were no errors with the same query on MySQL 5.5.48.