Skip to content

Instantly share code, notes, and snippets.

@tamakiii
Last active June 23, 2021 23:36
Show Gist options
  • Save tamakiii/c6a9092c782cde8d8834857324d67c51 to your computer and use it in GitHub Desktop.
Save tamakiii/c6a9092c782cde8d8834857324d67c51 to your computer and use it in GitHub Desktop.
MySQL Docker: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
$ docker-compose exec service mysql -u root -p -e "SELECT @@global.secure_file_priv;"
Enter password:
+---------------------------+
| @@global.secure_file_priv |
+---------------------------+
| /var/lib/mysql-files/     |
+---------------------------+
$ docker cp /path/to/source/table.tsv $(docker-compose ps -q service):/var/lib/mysql-files/
$ docker-compose exec service mysqlimport -u root -p database /var/lib/mysql-files/table.tsv

Ref.

database - How should I tackle --secure-file-priv in MySQL? - Stack Overflow

LOAD DATA INFILE solution · Issue #118 · docker-library/mysql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment