The server cannot read file status information, usually because the path is wrong, permissions are insufficient, or the underlying file system is unavailable.
MySQL Error 1013 (ER_CANT_GET_STAT) appears when the server cannot read the status of a referenced file or directory. Check path spelling, verify OS-level permissions, and confirm the storage device is mounted to resolve the issue.
Can't get status of '%s' (errno: %d - %s)
The error fires when MySQL issues a stat() system call to obtain metadata about a file or directory and the operating system returns an error code. The placeholder values in the message show the affected path and the OS error.
This failure blocks operations such as LOAD DATA INFILE, SELECT ...
INTO OUTFILE, FILE privilege checks, or table-space creation that depend on reading file metadata.
Administrators usually see it while importing data files, writing query output to disk, or adding tablespaces on external storage.
It can also appear during server start-up if the data directory or log files have moved.
Ignoring the error keeps the statement from completing and may leave partial files, so prompt resolution is critical.
MySQL cannot access the referenced path because the path is misspelled, the file or directory does not exist, the MySQL user lacks permissions, or the disk is offline or read-only.
In containerized or cloud environments, mount propagation or network-attached storage latency can trigger transient stat() failures.
Locate the failing path in the error message, confirm it exists, and ensure mysqld has read access.
On Linux, grant the mysql user execute permissions on parent directories and read permissions on the file itself.
Verify that the underlying device is mounted and writable.
In clustered setups, confirm shared storage is mounted on every node where mysqld runs.
Example: LOAD DATA INFILE fails with Error 1013.
# Check file presence
ls -l /var/lib/mysql-import/sales.csv
# Fix permissions if needed
sudo chown mysql:mysql /var/lib/mysql-import/sales.csv
sudo chmod 644 /var/lib/mysql-import/sales.csvLOAD DATA INFILE '/var/lib/mysql-import/sales.csv'
INTO TABLE sales
FIELDS TERMINATED BY ',';
If the command now succeeds, the issue was permissions.
Store import/export files inside directories owned by the mysql user.
Use absolute paths in SQL statements, and script pre-flight checks that validate file existence before running data-load jobs.
Galaxy’s SQL editor can embed such checks in snippets shared across teams, ensuring every user references valid, permission-safe paths.
Error 29 (ER_FILE_NOT_FOUND) occurs when the file is missing entirely, while Error 1 (EPERM) indicates a permission denial. Error 1017 (ER_CANT_LOCK) affects file locking, not status retrieval. Solutions overlap but root causes differ.
.
The supplied file or directory was deleted or never created, so stat() fails with ENOENT.
The mysql OS account lacks execute rights on parent directories or read rights on the target file, causing EACCES.
The directory resides on a network drive or external disk that is offline, returning ENODEV or EIO.
Security modules block mysqld from accessing the path even when traditional UNIX permissions appear correct.
Overly long paths or non-ASCII characters can break stat() on certain file systems and MySQL versions.
.
No. The error blocks the current statement but does not delete or corrupt existing data.
You can set secure_file_priv to an empty string, but this weakens security. Prefer moving files to the approved directory.
Volume mounts may lack correct UID/GID mapping or SELinux labels inside the container, leading to stat() failures.
Galaxy lets you store verified import/export snippets, share them with correct paths, and run pre-flight permission checks before execution.