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.
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.
The file '%s' must be in the database directory or be
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.
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.
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.
.
mysqld often runs as the mysql user. World-read permissions guarantee the server can open the file regardless of ownership, avoiding privilege escalation.
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.
Using LOAD DATA LOCAL INFILE shifts reading to the client connection, bypassing server file restrictions. Ensure the MySQL client and network allow LOCAL.
Galaxy’s query history and sharing ensure the correct file path and permissions are documented and reused, reducing recurrence of Error 1085.