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;
MySQL use this system variable to control where you can import you files
mysql> SHOW VARIABLES LIKE "secure_file_priv";
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| secure_file_priv | NULL |
+------------------+-------+
So problem is how to change system variables such as secure_file_priv
.
mysqld
sudo mysqld_safe --secure_file_priv=""
now you may see like this:
mysql> SHOW VARIABLES LIKE "secure_file_priv";
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| secure_file_priv | |
+------------------+-------+