How should I tackle --secure-file-priv in MySQL?

前端 未结 21 1083
攒了一身酷
攒了一身酷 2020-11-22 06:04

I am learning MySQL and tried using a LOAD DATA clause. When I used it as below:

LOAD DATA INFILE \"text.txt\" INTO table mytable;
21条回答
  •  有刺的猬
    2020-11-22 06:14

    Without changing any of the configuration files..

    1. look for the value of secure_file_priv using the command posted by @vhu: SHOW VARIABLES LIKE "secure_file_priv".
    2. define the full path for your query such as: select * from table into outfile 'secure_file_priv_PATH/OUTPUT-FILE' ... rest of your query

    this worked for my in mysql-shell on ubuntu 18.04 LTS mysql 5.7.29

提交回复
热议问题