The server cannot create or write to a temporary or target file because the OS blocks the operation.
MySQL Error 1: EE_CANTCREATEFILE occurs when the server cannot create or write to a file that a query needs, usually due to missing directory permissions or full disk space. Grant proper file-system rights, free disk space, or change tmpdir to a writable location to resolve the issue.
Can't create/write to file '%s' (OS errno %d - %s)
MySQL returns Error 1, condition name EE_CANTCREATEFILE, with the message "Can't create/write to file '%s' (OS errno %d - %s)" when it fails to create or write a file on the host operating system. The placeholder shows the path and OS-level error.
The failure can affect temporary tables, SELECT ... INTO OUTFILE, LOAD DATA, replication relay logs, or any operation that touches the file system.
Fixing it quickly prevents query failures and potential data loss.
.
Missing write permissions on the data directory or tmpdir stop MySQL from writing required files. The server process user must have create, write, and read rights.
Insufficient disk space or inode exhaustion also trigger the error.
Even with correct permissions, a full partition blocks file creation.
An incorrect or unwritable tmpdir path set in my.cnf leads to the same error during temp table or sorting operations.
OS-level security tools such as SELinux, AppArmor, or antivirus software can deny MySQL access, resulting in EE_CANTCREATEFILE.
.
First, inspect the filename in the error message to locate the failing directory. Check its permissions with ls -l and ensure the MySQL user owns or can write to it.
If the directory is correct, verify available space with df -h and inode usage with df -i. Free space or move the MySQL temp directory to a larger partition if necessary.
Confirm that tmpdir in my.cnf points to an existing, writable path.
Restart MySQL after changes to apply the new settings.
On SELinux or AppArmor systems, adjust policies or set contexts so the mysqld process can write to the target directory.
.
SELECT ... INTO OUTFILE fails when exporting to a protected directory. Change the path to /var/lib/mysql-files or grant write rights specifically for the export location.
Replication breaks because it cannot write relay logs. Make relay_log_path writable and ensure sufficient space on the partition.
Large GROUP BY queries hit the error while writing on-disk temp tables. Point tmpdir to /mnt/mysqltmp on a fast SSD with ample space and permissions.
Always place tmpdir and data directories on partitions with monitored free space and reserve thresholds.
Harden permissions by granting the minimal access needed to the mysql user, but verify write rights on tmpdir, datadir, and export directories.
Use Galaxy’s built-in query history and monitoring to detect long-running queries that spill to disk, helping you size tmpdir proactively.
Error 1290 (HY000) - The MySQL server is running with the --secure-file-priv option so it cannot execute this statement. Resolve by exporting to the secure-file-priv directory or disabling the option.
Error 13 - Permission denied from the OS when MySQL lacks correct file rights. Fix permissions similarly to EE_CANTCREATEFILE.
No. Lack of space, inode exhaustion, or security policies can also trigger the error.
Yes, if you only adjust permissions or free space. Changing tmpdir requires a restart.
MySQL blocks exports to arbitrary paths unless secure-file-priv is unset or the directory is writable and allowed.
Galaxy surfaces long temp-table writes and disk usage warnings in its editor, helping teams act before disk issues cause errors.