# ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

**Code:** `1290 secure-file-priv` · **Category:** MySQL · **Seen on:** MySQL

LOAD DATA / SELECT INTO OUTFILE is restricted to one directory (or disabled) by `secure_file_priv`.

## Meaning

MySQL only reads or writes files in the folder named by `secure_file_priv`; `NULL` disables file operations; an empty value allows any path. The default since 5.7/8 is a restricted folder such as `/var/lib/mysql-files`.

## Common causes

- File outside the allowed directory
- secure_file_priv = NULL
- Path with wrong case or symlink
- Cloud-managed MySQL forbids server-side file access

## Quick fix

1. Move the file to the directory shown by `SHOW VARIABLES LIKE 'secure_file_priv'`
2. Use `LOAD DATA LOCAL INFILE` with `local_infile=1`
3. Use `mysqlimport` / client-side tools

## Detailed fix by platform

### MySQL

1. `SHOW VARIABLES LIKE 'secure_file_priv';`

### my.cnf

1. `secure_file_priv=/var/import` (restart required; not changeable at runtime)

## How to diagnose

1. **Variable** — Value of secure_file_priv?
2. **Path** — Inside it?
3. **Managed** — Cloud database?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/mysql/secure-file-priv-option-1290)
