Common SQL Errors

MySQL Error 1017: ER_FILE_NOT_FOUND - Full Fix & Prevention Guide

Galaxy Team
August 5, 2025

MySQL cannot locate the physical table file (.frm, .ibd, MyISAM files) that the query or server startup expects.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 1017 (ER_FILE_NOT_FOUND)?

MySQL Error 1017: ER_FILE_NOT_FOUND is raised when the server cannot find the required table file (.frm, .ibd, .MYD, or .MYI) in the data directory. Confirm the file exists, correct permissions, and restore or rebuild the table to resolve the issue.

Error Highlights

Typical Error Message

Can't find file: '%s' (errno: %d - %s)

Error Type

File System / Storage Error

Language

MySQL

Symbol

ER_FILE_NOT_FOUND

Error Code

1017

SQL State

Explanation

Table of Contents

What does MySQL Error 1017: ER_FILE_NOT_FOUND mean?

The message "Can't find file: '%s' (errno: %d - %s)" signals that MySQL requested a table or index file on disk, but the operating system returned ENOENT (file not found). The missing file prevents all access to the table until fixed.

Depending on the storage engine, the absent object might be a .frm definition file, an InnoDB .ibd tablespace, or MyISAM data/index files.

The problem lives outside the SQL layer, so rewriting queries will not help until the file issue is solved.

When does this error usually appear?

The error surfaces during SELECT, INSERT, UPDATE, or ALTER TABLE statements on the affected table. It can also show up during server startup or FLUSH TABLES, because MySQL validates on-disk metadata at these points.

Production impact is high: the table becomes completely unavailable.

Replication can also break if the same table is accessed on a replica that lacks the file.

Why is a quick fix critical?

The error blocks reads and writes, causing application downtime and possible data loss if the filesystem problem indicates broader disk corruption. Immediate action restores service continuity and protects data integrity.

.

Common Causes

Missing or deleted table files

Manual deletion, failed backups, or cleanup scripts may remove .frm or .ibd files, leaving MySQL metadata pointing to nowhere.

Incorrect datadir or symbolic link

Moving the data directory without updating my.cnf or symbolic links misleads MySQL about the real file location.

Case sensitivity mismatch

On Windows and macOS, table names are case insensitive, while Linux is often case sensitive.

Renaming a table outside MySQL with the wrong case causes the server to look for a file that does not exist.

Permission or ownership errors

The files exist but cannot be read because the mysql user lacks correct UNIX permissions or SELinux denies access.

Disk corruption or hardware failure

Bad sectors or an unexpected shutdown may damage directory entries, making the filesystem think the file is gone.

.

Related Errors

FAQs

Does REPAIR TABLE fix ER_FILE_NOT_FOUND?

REPAIR works only if the table’s .frm file is present. If the file itself is missing, restore or recreate it first, then run REPAIR to rebuild indexes.

Can I ignore the error if the table is unused?

Yes, you can drop the orphaned table to clear metadata. Verify that no application relies on it, then execute DROP TABLE to remove references.

Will InnoDB file-per-table affect this error?

With innodb_file_per_table=ON, each table has its own .ibd. Losing that file triggers 1017. Turning the setting off centralizes storage but does not remove the risk of corruption.

How does Galaxy help prevent this issue?

Galaxy’s versioned queries and automatic backups surface when a table stops responding. The editor alerts on failed statements quickly so engineers can act before users notice.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo