Common SQL Errors

MySQL Error 1085: ER_TEXTFILE_NOT_READABLE - Fix File Read Permission Issues Fast

Galaxy Team
August 5, 2025

MySQL error 1085 occurs when LOAD DATA or SELECT ... INTO OUTFILE tries to access a text file that is not readable by the MySQL server process or is outside the data directory.

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 1085 ER_TEXTFILE_NOT_READABLE?

MySQL Error 1085: ER_TEXTFILE_NOT_READABLE appears when the server cannot read the referenced text file because it lies outside the database directory or lacks world-readable permissions. Move the file into the MySQL data directory and grant 644 permissions to resolve the issue.

Error Highlights

Typical Error Message

The file '%s' must be in the database directory or be

Error Type

File System Error

Language

MySQL

Symbol

ER_TEXTFILE_NOT_READABLE

Error Code

1085

SQL State

Explanation

Table of Contents

What is MySQL Error 1085: ER_TEXTFILE_NOT_READABLE?

Error 1085 fires when MySQL executes LOAD DATA INFILE or SELECT ... INTO OUTFILE and finds that the referenced file is not readable by the mysqld process or is located outside the server's permitted directory.

The exact message is: ER_TEXTFILE_NOT_READABLE - The file '%s' must be in the database directory or be readable by all.

MySQL rejects the statement to protect the server from unauthorized file access.

When does this error occur?

The error typically shows up after migrations, server hardening, container moves, or permission changes where data files are relocated or their UNIX permissions are tightened.

It also appears on shared hosting where the MySQL user does not own the uploaded file, and during automation scripts that create temp files in /tmp without adjusting modes.

Why is it important to fix quickly?

Failing LOAD DATA operations delay ETL pipelines, block data imports, and can leave applications without required seed data.

Prompt correction restores business continuity and avoids manual data entry.

.

Common Causes

Related Errors

FAQs

Why must the file be world-readable?

mysqld often runs as the mysql user. World-read permissions guarantee the server can open the file regardless of ownership, avoiding privilege escalation.

Can I disable secure-file-priv?

Yes, set secure-file-priv to an empty string in my.cnf to allow any path, but this reduces security. Prefer moving files into the approved directory.

Does LOCAL fix the problem?

Using LOAD DATA LOCAL INFILE shifts reading to the client connection, bypassing server file restrictions. Ensure the MySQL client and network allow LOCAL.

How does Galaxy help?

Galaxy’s query history and sharing ensure the correct file path and permissions are documented and reused, reducing recurrence of Error 1085.

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